hLS1bW+KjoOKgpOKhgOKggOKggOKggOKggOKggOKggOKggOKggOKggCDioIDioIDioIDioIDioIDioIDioIDio4Dio4DioIDioIAK4qCA4qCA4qGc4qCB4qCA4qCI4qKi4qGA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qKA4qO04qCL4qC34qC24qCx4qGECuKggOKiuOKjuOKjv+KggOKggOKggOKgmeKipuKhgOKggOKggOKggOKggOKggOKggOKggOKigOKhtOKgq+KigOKjluKhg+KigOKjuOKiuQrioIDioYfio7/io7/io7bio6TioYDioIDioIDioJnioobioIDioIDioIDioIDioIDio6DioariooDio6Tio77io7/io7/io7/io7/io7gK4qCA4qGH4qCb4qCb4qCb4qK/4qO/4qO34qOm4qOA4qCA4qOz4qOE4qCA4qKg4qO+4qCH4qOg4qO+4qO/4qO/4qO/4qO/4qO/4qO/4qO9CuKggOKgr+KjoOKjoOKjpOKjpOKjpOKjreKjreKhveKgv+KgvuKgnuKgm+Kgt+Kgp+KjvuKjv+Kjv+Kjr+Kjv+Khm+KjveKjv+Khv+KhvArioIDioYfio7/io7/io7/io7/ioJ/ioIvioIHioIDioIDioIDioIDioIDioIDioIDioIDioIjioJnioLvio7/io7/io67ioZvior/ioIMK4qCA4qOn4qOb4qOt4qG+4qCB4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCA4qCI4qK/4qO/4qO34qOO4qGHCuKggOKhuOKjv+Khn+KggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKggOKgmOKiv+Kjt+Kjn+Khhwrio5zio7/io7/ioafioIDioIDioIDioIDioIDioYDioIDioIDioIDioIDioIDioIDio4TioIDioIDioIDioIDioIDio7jio7/ioZzioYQK4qCJ4qCJ4qK54qGH4qCA4qCA4qCA4qKA4qOe4qCh4qCA4qCA4qCA4qCA4qCA4qCA4qGd4qOm4qCA4qCA4qCA4qCA4qK/4qO/4qO/4qO5CuKggOKggOKiuOKggeKggOKggOKioOKjj+KjqOKjieKhg+KggOKggOKggOKigOKjnOKhieKiieKjh+KggOKggOKggOKiueKhhOKggOKggArioIDioIDiob7ioITioIDioIDiorjio77ioo/ioY3ioY/ioJHioIbioIDior/io7vio7/io7/io7/ioIDioIDiorDioIjioYfioIDioIAK4qCA4qKw4qKH4qKA4qOG4qCA4qK44qCZ4qC+4qC94qCD4qCA4qCA4qCA4qCY4qC/4qG/4qCf4qK54qCA4qKA4qGO4qCA4qGH4qCA4qCACuKggOKgmOKiuuKju+KhuuKjpuKjq+KhgOKggOKggOKggOKjhOKjgOKjgOKggOKggOKggOKggOKinOKjoOKjvuKhmeKjhuKhh+KggOKggArioIDioIDioIDioJnior/iob/ioZ3ioL/ioqfioaLio6Dio6Tio43io4Dio6TioYTiooDio57io7/iob/io7vio7/ioJ7ioIDioIDioIAK4qCA4qCA4qCA4qKg4qCP4qCE4qCQ4qCA4qO84qO/4qO/4qO/4qO/4qO/4qO/4qO/4qO/4qGH4qCA4qCz4qKk4qOJ4qKz4qCA4qCA4qCACuKigOKhoOKgluKgieKggOKggOKjoOKgh+Kjv+Khv+Kjv+Khv+KiueKjv+Kjv+Kjv+Kjv+Kjp+KjoOKhgOKggOKgiOKgieKiouKhgOKggArior/ioIDioIDio6DioLTio4vioaTioJrioJvioJvioJvioJvioJvioJvioJvioJvioJnioJvioJvior/io6bio4TioIDioojioYfioIAK4qCI4qKT4qOk4qO14qO+4qCB4qOA4qOA4qCk4qOk4qOA4qCA4qCA4qCA4qCA4qKA4qGk4qC24qCk4qKM4qG54qC/4qC34qC74qKk4qGACuKisOKgi+KgiOKgieKgmOKgi+KggeKggOKggOKgiOKgmeKgs+KihOKjgOKhtOKgieKggOKggOKggOKggOKgmeKgguKggOKggOKigOKhhwriorjioaDioYDioIDioJLioILioJDioKLioIDio4DioIDioIDioIDioIDioIDiooDioKTioJrioIDioIDiorjio5TiooTioIDior7ioIAK4qCA4qCR4qC44qK/4qCA4qCA4qCA4q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RF9JRCgpLCAwLjUpCiAgICAgICAgZWxzZQogICAgICAgICAgICBsb2NhbCBzdHlsZSA9IG1vdmVtZW50X3N0eWxlLnZhbHVlW2luZGV4XQogICAgICAgICAgICByZXF1ZXN0X2FuaW1fc2V0KHN0eWxlKQogICAgICAgICAgICBQRUQuU0VUX1BFRF9NT1ZFTUVOVF9DTElQU0VUKFBMQVlFUi5QTEFZRVJfUEVEX0lEKCksIHN0eWxlLCAwLjUpCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKG1vdmVtZW50X29wdCwn6L2v6La06La056e75YqoJywge30sICflhbPpl63npoHnlKjmkZTlgJInLCBmdW5jdGlvbigpCiAgICAgICAgc29mdF9tb3ZpbmcoKQogICAgZW5kKQogICAgYXBwbWVudS5VbHRpb24uU3VwZXJtYW5GbHkgPSBtZW51LnRvZ2dsZShtb3ZlbWVudF9vcHQsICLonJjom5vkvqDpo57ooYwiLCB7fSwgIiIsIGZ1bmN0aW9uKG9uKQogICAgICAgIHN1cGVybWFuX2ZseShvbikKICAgIGVuZCkKICAgIGxzX3dhbGt3YXRlciA9IG1lbnUudG9nZ2xlKG1vdmVtZW50X29wdCwgIuWcqOawtOS4iuihjOi1sCIsIHt9LCAiIiwgIGZ1bmN0aW9uKG9uKQogICAgICAgIHdhbGtvbndhdGVyID0gb24KICAgICAgICBpZiBvbiB0aGVuCiAgICAgICAgICAgIG1lbnUuc2V0X3ZhbHVlKGxzX2RyaXZlb253YXRlciwgZmFsc2UpCiAgICAgICAgICAgIG1lbnUuc2V0X3ZhbHVlKGxzX2RyaXZlb25haXIsIGZhbHNlKQogICAgICAgIGVuZAogICAgZW5kKQogICAgbWVudS50b2dnbGUobW92ZW1lbnRfb3B0LCAi56m65Lit6KGM6LWwIiwge30sICLku4XpgILnlKjkuo7nur/kuIrpu5jorqTop5LoibIiLCBmdW5jdGlvbihvbikKICAgICAgICB3YWxrX29uX2FpcihvbikKICAgIGVuZCkKCmFzcG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mdW5jdGlvbihvbikKICAgICAgICByZW56aGVwYW8ob24pCiAgICBlbmQpCiAgICBwcmVzZXRzX2FjdGlvbiA9IG1lbnUubGlzdChhY3Rpb25fbGlzdCwgIumihOiuvuWKqOS9nCIsIHt9LCAiIikKICAgICAgICBtZW51LmFjdGlvbihwcmVzZXRzX2FjdGlvbiwgIuWJjeepuue/uyIsIHt9LCAi6KGo5ryU5LiA5Liq5YmN56m657+7IiwgZnVuY3Rpb24oKQogICAgICAgICAgICBmb3J3YXJkX3NvbWVyc2F1bHQoKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZShwcmVzZXRzX2FjdGlvbiwgIuW8ueWQieS7liIsIHt9LCAiIiwgZnVuY3Rpb24ob24pCiAgICAgICAgICAgIFBsYXlfZ3VpdGFyKG9uKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZShwcmVzZXRzX2FjdGlvbiwgIuaOjOaXi+eQgyIsIHt9LCAiIiwgZnVuY3Rpb24ob24pLS0tLUdUCiAgICAgICAgICAgIFBhbG1fc3Bpbl9iYWxsKG9uKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZShwcmVzZXRzX2FjdGlvbiwgIuS5nuaxgiIsIHt9LCAiIiwgZnVuY3Rpb24ob24pCiAgICAgICAgICAgIHNlZWtfaGVscChvbikKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGUocHJlc2V0c19hY3Rpb24sICLnjK7oirEiLCB7fSwgIiIsIGZ1bmN0aW9uKG9uKQogICAgICAgICAgICBvZmZlcl9mbG93ZXIob24pCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlKHByZXNldHNfYWN0aW9uLCAi5omT5LyeIiwge30sICIiLCBmdW5jdGlvbihvbikKICAgICAgICAgICAgaG9sZF91bWJyZWxsYShvbikKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcChwcmVzZXRzX2FjdGlvbiwgIuWJjea7mue/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oc29ud21hbiwgMCwgMC4wLCAwLCAtMSwgMCwgMCwwKQogICAgICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcih6aGFuZ3ppLCAwLCAwLjAsIDAsIDAsIDAsIDUwLDApCiAgICAgICAgICAgICAgICBhdHRhY2hfdG9fcGxheWVyKHpoYW5nemksIDAsIDAuMCwgMCwgMCwgMCwgMTI1LDApCiAgICAgICAgICAgICAgICBhdHRhY2hfdG9fcGxheWVyKHpoYW5nemksIDAsIDAuMCwgMCwgMCwgMCwgLTUwLDApCiAgICAgICAgICAgICAgICBhdHRhY2hfdG9fcGxheWVyKHpoYW5nemksIDAsIDAuMCwgMCwgMCwgMCwgLTEyNSwwKQogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICBkZWxldGVfb2JqZWN0KHNvbndtYW4pCiAgICAgICAgICAgICAgICBkZWxldGVfb2JqZWN0KHpoYW5nemkpCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZShhdHRhY2hfc25vd21hbiwgIumbquS6unYyIix7fSwgIiIsZnVuY3Rpb24ob24pCiAgICAgICAgICAgIGxvY2FsIHNvbndtYW4gPSAieG0zX3Byb3BfeG0zX3Nub3dtYW5fMDFiIgogICAgICAgICAgICBpZiBvbiB0aGVuCiAgICAgICAgICAgICAgICBhdHRhY2hfdG9fcGxheWVyKHNvbndtYW4sIDAsIDAsIDAsIC0wLjcsIDAsIDAsIDE4MCkKICAgICAgICAgICAgICAgIEVOVElUWS5TRVRfRU5USVRZX0FMUEhBKFBMQVlFUi5QTEFZRVJfUEVEX0lEKCksIDAsIGZhbHNlKQogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICBkZWxldGVfb2JqZWN0KHNvbndtYW4pCiAgICAgICAgICAgICAgICBFTlRJVFkuU0VUX0VOVElUWV9BTFBIQShQTEFZRVIuUExBWUVSX1BFRF9JRCgpLCAyNTUsIGZhbHNlKQogICAgICAgICAgICBlbmQKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGUoYXR0YWNoX3Nub3dtYW4sICLpm6rkurp2MyIse30sICIiLGZ1bmN0aW9uKG9uKQogICAgICAgICAgICBsb2NhbCBzb253bWFuID0gInhtM19wcm9wX3htM19zbm93bWFuXzAxYyIKICAgICAgICAgICAgaWYgb24gdGhlbgogICAgICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcihzb253bWFuLCAwLCAwLCAwLCAtMC43LCAwLCAwLCAxODApCiAgICAgICAgICAgICAgICBFTlRJVFkuU0VUX0VOVElUWV9BTFBIQShQTEFZRVIuUExBWUVSX1BFRF9JRCgpLCAwLCBmYWxzZSkKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgZGVsZXRlX29iamVjdChzb253bWFuKQogICAgICAgICAgICAgICAgRU5USVRZLlNFVF9FTlRJVFlfQUxQSEEoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgMjU1LCBmYWxzZSkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlKGF0dGFjaF9zbm93bWFuLCAi6Zuq5Lq6djQiLHt9LCAiIixmdW5jdGlvbihvbikKICAgICAgICAgICAgbG9jYWwgc29ud21hbiA9ICJ4bTNfcHJvcF94bTNfc25vd21hbl8wMWEiCiAgICAgICAgICAgIGlmIG9uIHRoZW4KICAgICAgICAgICAgICAgIGF0dGFjaF90b19wbGF5ZXIoc29ud21hbiwgMCwgMCwgMCwgLTAuNywgMCwgMCwgMTgwKQogICAgICAgICAgICAgICAgRU5USVRZLlNFVF9FTlRJVFlfQUxQSEEoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgMCwgZmFsc2UpCiAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgIGRlbGV0ZV9vYmplY3Qoc29ud21hbikKICAgICAgICAgICAgICAgIEVOVElUWS5TRVRfRU5USVRZX0FMUEhBKFBMQVlFUi5QTEFZRVJfUEVEX0lEKCksIDI1NSwgZmFsc2UpCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKCiAgICAgICAgYXR0YWNoX0hhbmRtYWRlID0gbWVudS5saXN0KGF0dGFjaF9zZWxmLCAi5omL5Yqe6IOM5YyFIiwge30pCiAgICAgICAgICAgIGZvciBrLCB2IGluIHBhaXJzKHBsdXNoaWVwYWNrX2xpc3QpIGRvCiAgICAgICAgICAgICAgICBtZW51LnRvZ2dsZShhdHRhY2hfSGFuZG1hZGUsIHYubmFtZSwge30sICIiLCBmdW5jdGlvbiAodG9nZ2xlZCkKICAgICAgICAgICAgICAgICAgICBhZGRfcHJvcHModG9nZ2xlZCwgdikKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgZW5kCgoKICAgIG1lbnUudG9nZ2xlKGF0dGFjaF9zZWxmLCAi5aiD5aiD54aK5oyC5Lu2Iix7fSwgIiIsZnVuY3Rpb24ob24pCiAgICAgICAgb2JqID0gInZfaWxldl9tcl9yYXNiZXJyeWNsZWFuIgogICAgICAgIGlmIG9uIHRoZW4gICAgIAogICAgICAgICAgICBhdHRhY2hfdG9fcGxheWVyKG9iaiwgMCwgMCwgLTAuMiwgMC4yNSwgMCwgMzAsMCkKICAgICAgICBlbHNlCiAgICAgICAgICAgIGRlbGV0ZV9vYmplY3Qob2JqKQogICAgICAgIGVuZAogICAgZW5kKQogICAgbWVudS50b2dnbGUoYXR0YWNoX3NlbGYsICLliZHlnKMiLCB7fSwgIiIsIGZ1bmN0aW9uKHN0YXRlKQogICAgICAgIGxvY2FsIG9iaiA9ICJwcm9wX2NzX2thdGFuYV8wMSIKICAgICAgICBpZiBzdGF0ZSB0aGVuCiAgICAgICAgICAgIGF0dGFjaF90b19wbGF5ZXIob2JqLCAwLCAwLCAtMC4xMywgMC41LCAwLCAtMTUwLDApCiAgICAgICAgICAgIGF0dGFjaF90b19wbGF5ZXIob2JqLCAwLCAwLCAtMC4xMywgMC41LCAwLCAxNTAsMCkKICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcihvYmosIDAsIDAuMjMsIDAsIDAsIDAsIC0xODAsMTAwKQogICAgICAgIGVsc2UKICAgICAgICAgICAgZGVsZXRlX29iamVjdChvYmopCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZShhdHRhY2hfc2VsZiwgIjY2NiIse30sICIiLGZ1bmN0aW9uKG9uKQogICAgICAgIG9iaiA9ICJwcm9wX21wX251bV82IgogICAgICAgIGlmIG9uIHRoZW4gICAgIAogICAgICAgICAgICBhdHRhY2hfdG9fcGxheWVyKG9iaiwgMCwgMCwgMCwgMS43LCAwLCAwLCAxODApCiAgICAgICAgICAgIGF0dGFjaF90b19wbGF5ZXIob2JqLCAwLCAxLCAwLCAxLjcsIDAsIDAsIDE4MCkKICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcihvYmosIDAsIC0xLCAwLCAxLjcsIDAsIDAsIDE4MCkKICAgICAgICBlbHNlCiAgICAgICAgICAgIGRlbGV0ZV9vYmplY3Qob2JqKQogICAgICAgIGVuZAogICAgZW5kKQogICAgbWVudS50b2dnbGUoYXR0YWNoX3NlbGYsICLlhrLmtarmnb8iLHt9LCAiIixmdW5jdGlvbihvbikKICAgICAgICBvYmogPSAicHJvcF9zdXJmX2JvYXJkX2xkbl8wMyIKICAgICAgICBpZiBvbiB0aGVuICAgICAKICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcihvYmosIDAsIDAsIC0wLjIsIDAuMjUsIDAsIC0zMCwwKQogICAgICAgIGVsc2UKICAgICAgICAgICAgZGVsZXRlX29iamVjdChvYmopCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZShhdHRhY2hfc2VsZiwgIuWwj+S5puWMhSIse30sICIiLGZ1bmN0aW9uKG9uKQogICAgICAgIG9iaiA9ICJ0cl9wcm9wX3RyX2JhZ19kamxwXzAxYSIKICAgICAgICBpZiBvbiB0aGVuICAgICAKICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcihvYmosIDAsIDAsIC0wLjIsIDAuMSwgMCwgMCwwKQogICAgICAgIGVsc2UKICAgICAgICAgICAgZGVsZXRlX29iamVjdChvYmopCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZShhdHRhY2hfc2VsZiwgIuazs+WciCIse30sICIiLGZ1bmN0aW9uKG9uKQogICAgICAgIG9iaiA9ICJwcm9wX2JlYWNoX3JpbmdfMDEiCiAgICAgICAgaWYgb24gdGhlbiAgICAgCiAgICAgICAgICAgIGF0dGFjaF90b19wbGF5ZXIob2JqLCAwLCAwLCAwLCAwLCAwLCAwLDApCiAgICAgICAgZWxzZQogICAgICAgICAgICBkZWxldGVfb2JqZWN0KG9iaikKICAgICAgICBlbmQKICAgIGVuZCkKICAgIGd1aXRhcl9vYmogPSBtZW51Lmxpc3QoYXR0YWNoX3NlbGYsICLlkInku5YiKQogICAgICAgIG1lbnUudG9nZ2xlKGd1aXRhcl9vYmosICLlkInku5YxIix7fSwgIiIsZnVuY3Rpb24ob24pCiAgICAgICAgICAgIGxvY2FsIG9iaiA9ICJwcm9wX2FjY19ndWl0YXJfMDEiCiAgICAgICAgICAgIGlmIG9uIHRoZW4gICAgIAogICAgICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcihvYmosIDAsIDAsIC0wLjE1LCAwLjI1LCAwLCAtNTAsMCkKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgZGVsZXRlX29iamVjdChvYmopCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZShndWl0YXJfb2JqLCAi5ZCJ5LuWMiIse30sICIiLGZ1bmN0aW9uKG9uKQogICAgICAgICAgICBsb2NhbCBvYmogPSAicHJvcF9lbF9ndWl0YXJfMDMiCiAgICAgICAgICAgIGlmIG9uIHRoZW4gICAgIAogICAgICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcihvYmosIDAsIDAsIC0wLjE1LCAwLjI1LCAwLCAtNTAsMCkKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgZGVsZXRlX29iamVjdChvYmopCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZShndWl0YXJfb2JqLCAi5ZCJ5LuWMyIse30sICIiLGZ1bmN0aW9uKG9uKQogICAgICAgICAgICBsb2NhbCBvYmogPSAicHJvcF9lbF9ndWl0YXJfMDEiCiAgICAgICAgICAgIGlmIG9uIHRoZW4gICAgIAogICAgICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcihvYmosIDAsIDAsIC0wLjE1LCAwLjI1LCAwLCAtNTAsMCkKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgZGVsZXRlX29iamVjdChvYmopCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZShndWl0YXJfb2JqLCAi5ZCJ5LuWNCIse30sICIiLGZ1bmN0aW9uKG9uKQogICAgICAgICAgICBsb2NhbCBvYmogPSAicHJvcF9lbF9ndWl0YXJfMDIiCiAgICAgICAgICAgIGlmIG9uIHRoZW4gICAgIAogICAgICAgICAgICAgICAgYXR0YWNoX3RvX3BsYXllcihvYmosIDAsIDAsIC0wLjE1LCAwLjI1LCAwLCAtNTAsMCkKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgZGVsZXRlX29iamVjdChvYmopCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlX2xvb3AoYXR0YWNoX3NlbGYsICLplZzlrZAiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICBpZiBHUkFQSElDUy5VSTNEU0NFTkVfSVNfQVZBSUxBQkxFKCkgdGhlbgogICAgICAgICAgICBpZiBHUkFQSElDUy5VSTNEU0NFTkVfUFVTSF9QUkVTRVQoIkNFTEVCUkFUSU9OX1dJTk5FUiIpIHRoZW4KICAgICAgICAgICAgICAgIEdSQVBISUNTL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ciA9IG1lbnUubGlzdChvbmxpbmUsICLmiJjlsYDkv6Hmga8iLCB7fSwgIiIpCiAgICBwbGF5X2luZm8gPW1lbnUubGlzdChvbmxpbmVfb3RoZXIsICLnjqnlrrbkv6Hmga8iLCB7fSwgIiIpCiAgICAgICAgcmVxdWlyZSAibGliLlNha3VyYVNjcmlwdC5JbmZPdmVybGF5IgogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AocGxheV9pbmZvLCAi57uY5Yi2546p5a625qih5Z6LIiwge30sICLlvZPpgInkuK3njqnlrrbml7bpooTop4jnjqnlrrbmqKHlnosiLGZ1bmN0aW9uKCkKICAgICAgICAgICAgRHJhd19wbGF5ZXJfbW9kZWwoKQogICAgICAgIGVuZCkKCiAgICBtZW51LnRvZ2dsZV9sb29wKG9ubGluZV9vdGhlciwgIueOqeWutuWKoOWFpemAmuefpSIsIHt9LCAiIiwgZnVuY3Rpb24gKCkKICAgICAgICBwbGF5ZXJfam9pbihmdW5jdGlvbihwaWQsIG5hbWUpCiAgICAgICAgICAgIHV0aWwudG9hc3QoIlvliqDlhaXmuLjmiI9dICIgLi4gUExBWUVSLkdFVF9QTEFZRVJfTkFNRShwaWQpKQogICAgICAgIGVuZCkKICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlX2xvb3Aob25saW5lX290aGVyLCAi546p5a6256a75byA6YCa55+lIiwge30sICIiLCBmdW5jdGlvbiAoKQogICAgICAgIHBsYXllcl9sZWF2ZShmdW5jdGlvbihwaWQsIG5hbWUpCiAgICAgICAgICAgIHV0aWwudG9hc3QoIlvnprvlvIDmuLjmiI9dICIgLi4gbmFtZSkKICAgICAgICBlbmQpCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKG9ubGluZV9vdGhlciwgIuWFs+mXreeUteWPsCIsIHt9LCAiIixmdW5jdGlvbigpCiAgICAgICAgQVVESU8uU0VUX01PQklMRV9SQURJT19FTkFCTEVEX0RVUklOR19HQU1FUExBWShmYWxzZSkKICAgICAgICBBVURJTy5TRVRfUkFESU9fVE9fU1RBVElPTl9OQU1FKCJPRkYiKQogICAgZW5kKQogICAgbWVudS50b2dnbGUob25saW5lX290aGVyLCAi56e75Yqo55S15Y+wIiwge30sICLorqnkvaDmraXooYznmoTml7blgJnkuZ/og73lkKznlLXlj7AiLGZ1bmN0aW9uKHRvZ2dsZWQpCiAgICAgICAgQVVESU8uU0VUX01PQklMRV9SQURJT19FTkFCTEVEX0RVUklOR19HQU1FUExBWSh0b2dnbGVkKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcChvbmxpbmVfb3RoZXIsICflkIzmraXml7bpl7QnLCB7fSwgJ+S4jueOsOWunuaXtumXtOWQjOatpScsIGZ1bmN0aW9uKCkKICAgICAgICBSZWFsX3dvcmxkX3RpbWUoKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcChvbmxpbmVfb3RoZXIsIue7mOWItua1t+aLlCIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIGxvY2FsIHBvcyA9IEVOVElUWS5HRVRfRU5USVRZX0NPT1JEUyhQTEFZRVIuUExBWUVSX1BFRF9JRCgpLCB0cnVlKQogICAgICAgIGxvY2FsIHN0cmcgPSAifmJ+IEVsZXZhdGlvbiB+d34iLi5tYXRoLmNlaWwocG9zLnopIC8gMTAwMCAuLiJLTSIKICAgICAgICBkcmF3X3N0cmluZyhzdHJnLCAwLjAzLCAwLjEsIDAuNiwgNCkKICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlX2xvb3Aob25saW5lX290aGVyLCLnu5jliLbliLDlr7zoiKrngrnnmoTot53nprsiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICBpZiBIVUQuSVNfV0FZUE9JTlRfQUNUSVZFKCkgdGhlbgogICAgICAgICAgICBsb2NhbCBwb3MgPSBFTlRJVFkuR0VUX0VOVElUWV9DT09SRFMoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgdHJ1ZSkKICAgICAgICAgICAgbG9jYWw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JlYXRlX29iamVjdChtZGQsIHYzKDMzNS45LCA0ODMzLjksIC01OS4wKSkKICAgICAgICAgICAgICAgIEVOVElUWS5TRVRfRU5USVRZX0hFQURJTkcob3JiX29ial9zbWMsIDEyNS4wKQogICAgICAgICAgICAgICAgRU5USVRZLkZSRUVaRV9FTlRJVFlfUE9TSVRJT04ob3JiX29ial9zbWMsIHRydWUpCiAgICAgICAgICAgIGVuZDtlbmQsZnVuY3Rpb24oKQogICAgICAgICAgICBpZiBvcmJfb2JqX3NtYyB+PSBuaWwgdGhlbgogICAgICAgICAgICAgICAgZGVsZXRlX2VudGl0eShvcmJfb2JqX3NtYykKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoYWxsX3Nwb29mLCAgIuemgeatoui/m+WFpemrmOi3n+meiyIsIHt9LCAi55Sf5oiQ5LiA5Liq54mp5L2TIOaMoeS9j+mrmOi3n+mei+eahOmXqCIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgbG9jYWwgbWRkID0gdXRpbC5qb2FhdCgiaDRfcHJvcF9oNF9nYXJhZ2VfZG9vcl8wMWEiKQogICAgICAgICAgICBsb2NhbCBwb3MgPSBwbGF5ZXJzLmdldF9wb3NpdGlvbihQTEFZRVIuUExBWUVSX0lEKCkpCiAgICAgICAgICAgIGlmIG9yYl9vYmpfaGggPT0gbmlsIG9yIG5vdCBFTlRJVFkuRE9FU19FTlRJVFlfRVhJU1Qob3JiX29ial9oaCkgdGhlbgogICAgICAgICAgICAgICAgb3JiX29ial9oaCA9IGVudGl0aWVzLmNyZWF0ZV9vYmplY3QobWRkLCB2MygxMjgsIC0xMjk4LjUsIDI5LjUpKQogICAgICAgICAgICAgICAgRU5USVRZLlNFVF9FTlRJVFlfUk9UQVRJT04ob3JiX29ial9oaCwgMC4wLCAwLjAsIDMwLCAxLCB0cnVlKQogICAgICAgICAgICAgICAgRU5USVRZLkZSRUVaRV9FTlRJVFlfUE9TSVRJT04ob3JiX29ial9oaCwgdHJ1ZSkKICAgICAgICAgICAgZW5kO2VuZCxmdW5jdGlvbigpCiAgICAgICAgICAgIGlmIG9yYl9vYmpfaGggfj0gbmlsIHRoZW4KICAgICAgICAgICAgICAgIGRlbGV0ZV9lbnRpdHkob3JiX29ial9oaCkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoYWxsX3Nwb29mLCAi6ISa5pys5Li75py66L2u55uYIiwge30sICLlvqrnjq/nu5nkuojmiYDmnInkurrohJrmnKzkuLvmnLpcbuWPr+iDveegtOWdj+aImOWxgCIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgZm9yIF8sIHBpZCBpbiBpcGFpcnMocGxheWVycy5saXN0KGZhbHNlLCB0cnVlLCB0cnVlKSkgZG8KICAgICAgICAgICAgICAgIG1lbnUudHJpZ2dlcl9jb21tYW5kcygiZ2l2ZXNoIiAuLiBwbGF5ZXJzLmdldF9uYW1lKHBpZCkpCiAgICAgICAgICAgICAgICB1dGlsLnlpZWxkKDE1MDApCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBhdXRvX2JvdW50eSA9IG1lbnUubGlzdChhbGxfc3Bvb2YsICLlhajlsYDmgqzotY8iLCB7fSwgIiIpCiAgICAgICAgICAgIGxvY2FsIHNlc3Npb25fYm91bnR5X2Ftb3VudCA9IDEwMDAwCiAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoYXV0b19ib3VudHksIuiHquWKqOaCrOi1jyIse30sIuW+queOr+WQkeavj+S4quS6uuaPkOS+m+aCrOi1jyIsZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgZm9yIHBpZCA9IDAsIDMxIGRvCiAgICAgICAgICAgICAgICAgICAgaWYgcGlkIH49IFBMQVlFUi5QTEFZRVJfSUQoKSBhbmQgcGxheWVycy5nZXRfYm91bnR5KHBpZCkgfj0gc2Vzc2lvbl9ib3VudHlfYW1vdW50IGFuZCBQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSB+PSAwIHRoZW4KICAgICAgICAgICAgICAgICAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJib3VudHkiLi5wbGF5ZXJzLmdldF9uYW1lKHBpZCkuLiIgIi4uc2Vzc2lvbl9ib3VudHlfYW1vdW50KQogICAgICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICB1dGlsLnlpZWxkKDUwMDApCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgYXV0b19ib3VudHk6c2xpZGVyKCLmgqzotY/ph5Hpop0iLHsiYXV0b2JvdW50eWFtb3VudCJ9LCLpgInmi6noh6rliqjmj5DkvpvnmoTotY/ph5Hph5Hpop0iLDEsMTAwMDAsMTAwMDAsMTAwMCxmdW5jdGlvbihhbW91bnQpCiAgICAgICAgICAgICAgICBzZXNzaW9uX2JvdW50eV9hbW91bnQgPSBhbW91bnQKICAgICAgICAgICAgZW5kKQoKICAgICAgICBtZW51LmFjdGlvbihhbGxfc3Bvb2YsICLliqvmjIHmiYDmnInovb3lhbciLCB7fSwgIueUn+aIkOS4gOS4quWKq+WMqk5QQyzmiorku5bku6zku47ovabph4zluKblh7rmnaXlubblvIDotbDlvIAuIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBmb3IgXywgcGlkIGluIHBsYXllcnMubGlzdChmYWxzZSwgdHJ1ZSwgdHJ1ZSkgZG8KICAgICAgICAgICAgICAgIGxvY2FsIHBlZCA9IFBMQVlFUi5HRVRfUExBWUVSX1BFRF9TQ1JJUFRfSU5ERVgocGlkKQogICAgICAgICAgICAgICAgbG9jYWwgcG9zID0gcGxheWVycy5nZXRfcG9zaXRpb24ocGlkKQogICAgICAgICAgICAgICAgbG9jYWwgcGVkX2Rpc3QgPSB2My5kaXN0YW5jZShwbGF5ZXJzLmdldF9wb3NpdGlvbihQTEFZRVIuUExBWUVSX0lEKCkpLCBwbGF5ZXJzLmdldF9wb3NpdGlvbihwaWQpKQogICAgICAgICAgICAgICAgbG9jYWwgY2FtX2Rpc3QgPSB2My5kaXN0YW5jZShwb3MsIHBsYXllcnMuZ2V0X2NhbV9wb3MoUExBWUVSLlBMQVlFUl9JRCgpKSkKCiAgICAgICAgICAgICAgICBpZiBwZWRfZGlzdCA8IDEwMDAuMCBhbmQgY2FtX2Rpc3QgPCAxMDAwLjAgYW5kIFBFRC5JU19QRURfSU5fQU5ZX1ZFSElDTEUocGVkLCBmYWxzZSkgdGhlbgogICAgICAgICAgICAgICAgICAgIG1lbnUudHJpZ2dlcl9jb21tYW5kcygiaGlqYWNrICIgLi4gcGxheWVycy5nZXRfbmFtZShwaWQpKQogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKGFsbF9zcG9vZiwgIumUgeWumuWFqOmDqOi9veWFtyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBmb3IgXywgcGlkIGluIHBsYXllcnMubGlzdChmYWxzZSwgdHJ1ZSwgdHJ1ZSkgZG8KICAgICAgICAgICAgICAgIGZvciBpLCB2ZWhpY2xlIGluIGVudGl0aWVzLmdldF9hbGxfdmVoaWNsZXNfYXNfaGFuZGxlcygpIGRvCiAgICAgICAgICAgICAgICAgICAgVkVISUNMRS5TRVRfVkVISUNMRV9ET09SU19MT0NLRURfRk9SX1BMQVlFUih2ZWhpY2xlLCBwaWQsIHRydWUpCiAgICAgICAgICAgICAgICAgICAgdXRpbC55aWVsZCgpCiAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoYWxsX3Nwb29mLCAgIui1jOWcuumZt+mYsSIsIHt9LCAiIiwgZnVuY3Rpb24oKSAKICAgICAgICAgICAgICAgIGxvY2FsIG1kbCA9IHV0aWwuam9hYXQoImhlaV9wcm9wX3NzMV9tcGludF9nYXJhZ2UyIikKICAgICAgICAgICAgICAgIHJlcXVlc3RfbW9kZWwobWRsKQogICAgICAgICAgICAgICAgaWYgdHJhcF9vYmogPT0gbmlsIG9yIHRyYXBfb2JqMiA9PSBuaWwgb3Igbm90IEVOVElUWS5ET0VTX0VOVElUWV9FWElTVCh0cmFwX29iaikgb3Igbm90IEVOVElUWS5ET0VTX0VOVElUWV9FWElTVCh0cmFwX29iajIpIHRoZW4KICAgICAgICAgICAgICAgICAgICB0cmFwX29iaiA9IGVudGl0aWVzLmNyZWF0ZV9vYmplY3QobWRsLCB2MygxMDg5LjYyLCAyMDYuMzM0LCAtNDguNDczKSkKICAgICAgICAgICAgICAgICAgICB0cmFwX29iajIgPSBlbnRpdGllcy5jcmVhdGVfb2JqZWN0KG1kbCwgdjMoMTA5MC4wMTY2LCAyMTMuODI2LCAtNDguNDczKSkKICAgICAgICAgICAgICAgICAgICBFTlRJVFkuU0VUX0VOVElUWV9IRUFESU5HKHRyYXBfb2JqMiwgMzEuMCkKICAgICAgICAgICAgICAgICAgICBsb2NhbCBvYmpzID0ge3RyYXBfb2JqLCB0cmFwX29iajJ9CiAgICAgICAgICAgICAgICAgICAgZm9yIF8sIG9iaiBpbiBvYmpzIGRvCiAgICAgICAgICAgICAgICAgICAgICAgIGVudGl0aWVzLnNldF9jYW5fbWlncmF0ZShlbnRpdGllcy5oYW5kbGVfdG9fcG9pbnRlcihvYmopLCBmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgRU5USVRZLkZSRUVaRV9FTlRJVFlfUE9TSVRJT04ob2JqLCB0cnVlKQogICAgICAgICAgICAgICAgICAgICAgICBFTlRJVFkuU0VUX0VOVElUWV9OT19DT0xMSVNJT05fRU5USVRZKFBMQVlFUi5QTEFZRVJfUEVEX0lEKCksIG9iaiwgZmFsc2UpCiAgICAgICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgIHV0aWwueWllbGQoKQogICAgICAgICAgICBlbmQsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgIGxvY2FsIG9ianMgPSB7dHJhcF9vYmosIHRyYXBfb2JqMn0KICAgICAgICAgICAgICAgIGZvciBfLCBvYmogaW4gb2JqcyBkbwogICAgICAgICAgICAgICAgICAgIGlmIG9iaiB+PSBuaWwgdGhlbgogICAgICAgICAgICAgICAgICAgICAgICBORVRXT1JLLk5FVFdPUktfUkVRVUVTVF9DT05UUk9MX09GX0VOVElUWShvYmopCiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZV9lbnRpdHkob2JqKQogICAgICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIHBlbml0ZW50aWFyeSA9IG1lbnUubGlzdChhbGxfc3Bvb2YsICLnm5Hni7EiKQogICAgICAgICAgICBtZW51LmFjdGlvbihwZW5pdGVudGlhcnksICLliJvlu7rnm5Hni7EiLCB7fSwgIuS7vzJ055uR54uxIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgbG9jYWwgaGFzaCA9IDc3OTI3NzY4MgogICAgICAgICAgICAgICAgbG9jYWwgY2FnZSA9IE9CSkVDVC5DUkVBVEVfT0JKRUNUX05PX09GRlNFVChoYXNoLCA5NzAsIC0xMDIwLCA0MCwgdHJ1ZSwgZmFsc2UsIGZhbHNlKQogICAgICAgICAgICAgICAgRU5USVRZLlNFVF9FTlRJVFlfUk9UQVRJT04oY2FnZSwgMC4wLCAtOTAuMCwgMC4wLCAxLCB0cnVlKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUuYWN0aW9uKHBlbml0ZW50aWFyeSwgIuWIm+W7uuebkeeLsTIiLCB7fSwgIjJ055uR54uxIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgbG9jYWwgaGFzaCA9IDI2NzY0ODE4MQogICAgICAgICAgICAgICAgbG9jYWwgY2FnZTEgPSBPQkpFQ1QuQ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5USVRZX1JPVEFUSU9OKGNhZ2U0LCAwLjAsIDAuMCwgLTQ0LCAxLCB0cnVlKQogICAgICAgICAgICAgICAgRU5USVRZLkZSRUVaRV9FTlRJVFlfUE9TSVRJT04oY2FnZTQsIHRydWUpCiAgICAgICAgICAgICAgICBsb2NhbCBjYWdlNSA9IE9CSkVDVC5DUkVBVEVfT0JKRUNUX05PX09GRlNFVChoYXNoLCA5NjcsIC0xMDEyLCA0MS41LCB0cnVlLCBmYWxzZSwgZmFsc2UpCiAgICAgICAgICAgICAgICBFTlRJVFkuU0VUX0VOVElUWV9ST1RBVElPTihjYWdlNSwgMC4wLCAwLjAsIC01LCAxLCB0cnVlKQogICAgICAgICAgICAgICAgRU5USVRZLkZSRUVaRV9FTlRJVFlfUE9TSVRJT04oY2FnZTUsIHRydWUpCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS5hY3Rpb24ocGVuaXRlbnRpYXJ5LCAi5Y+R6YCB5omA5pyJ546p5a625Yiw55uR54uxIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoImFwdDI0YWxsIikKICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBtZW51LmFjdGlvbihwZW5pdGVudGlhcnksICLlsIboh6rlt7HkvKDpgIHliLDnm5Hni7HlpJbkvqciLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgIHRlbGVwb3J0KDk5NCwgLTEwMTMsIDQyLCB0cnVlKQogICAgICAgICAgICBlbmQpCgogICAgICAgIG1lbnUuYWN0aW9uKGFsbF9zcG9vZiwgIuWMv+WQjeadgOS6uiIsIHt9LCAi5Yy/5ZCN5p2A5q275omA5pyJ5Lq6IiwgZnVuY3Rpb24oKQogICAgICAgICAgICBuaW1pbmdzaGFyZW4oKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbihhbGxfc3Bvb2YsICfniIbngrjmiYDmnInkuronLCB7fSwgJ+eIhueCuOaJgOacieeOqeWuti4nLCBmdW5jdGlvbigpCiAgICAgICAgICAgIGZvciBrLCBwaWQgaW4gcGFpcnMocGxheWVycy5saXN0KGZhbHNlLCB0cnVlLCB0cnVlKSkgZG8KICAgICAgICAgICAgICAgIGtpbGxfcGxheWVyKHBpZCkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoYWxsX3Nwb29mLCAn5b6q546v54iG54K45omA5pyJ5Lq6Jywge30sICfkuI3mlq3nmoTniIbngrjmiYDmnInnjqnlrrYuJywgZnVuY3Rpb24oKQogICAgICAgICAgICBmb3IgaywgcGlkIGluIHBhaXJzKHBsYXllcnMubGlzdChmYWxzZSwgdHJ1ZSwgdHJ1ZSkpIGRvCiAgICAgICAgICAgICAgICBraWxsX3BsYXllcihwaWQpCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbihhbGxfc3Bvb2YsICLovabovobnlLXno4HohInlhrIiLCB7fSwgIuiuqeavj+S4quS6uueahOi9pumDveeGhOeBqyIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgdmVoX0VNUCgpCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoYWxsX3Nwb29mLCAn56aB6aOe5Yy6Jywge30sICflvLrov6vmiYDmnInkuZjlnZDpo57ooYzovb3lhbfnmoTnjqnlrrblm57liLDlnLDpnaIuJywgZnVuY3Rpb24oKQogICAgICAgICAgICBmb3IgXywgcGlkIGluIHBhaXJzKHBsYXllcnMubGlzdChmYWxzZSwgdHJ1ZSwgdHJ1ZSkpIGRvCiAgICAgICAgICAgICAgICBsb2NhbCBwbGF5ZXJQZWQgPSBQTEFZRVIuR0VUX1BMQVlFUl9QRURfU0NSSVBUX0lOREVYKHBpZCkKICAgICAgICAgICAgICAgIGxvY2FsIHBsYXllclZlaGljbGUgPSBQRUQuR0VUX1ZFSElDTEVfUEVEX0lTX0lOKHBsYXllclBlZCwgZmFsc2UpCiAgICAgICAgICAgICAgICBpZiBFTlRJVFkuSVNfRU5USVRZX0lOX0FJUihwbGF5ZXJWZWhpY2xlKSB0aGVuCiAgICAgICAgICAgICAgICAgICAgTkVUV09SSy5ORVRXT1JLX1JFUVVFU1RfQ09OVFJPTF9PRl9FTlRJVFkocGxheWVyVmVoaWNsZSkKICAgICAgICAgICAgICAgICAgICBFTlRJVFkuQVBQTFlfRk9SQ0VfVE9fRU5USVRZKHBsYXllclZlaGljbGUsIDEsIDAsIDAsIC0wLjgsIDAsIDAsIDAuNSwgMCwgZmFsc2UsIGZhbHNlLCB0cnVlKQogICAgICAgICAgICAgICAgICAgIHVpdGwudG9hc3QoJ+W3suW6lOeUqOW8uuWItui/lOWbnuWcsOmdoicpCiAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUuYWN0aW9uKGFsbF9zcG9vZiwgIuWbsOS9j+aJgOacieeOqeWutiIsIHt9LCAiIiwgZnVuY3Rpb24gKCkgCiAgICAgICAgICAgIGZvciBfLCBwaWQgaW4gcGFpcnMocGxheWVycy5saXN0KGZhbHNlLCB0cnVlLCB0cnVlKSkgZG8KICAgICAgICAgICAgICAgIGxvY2FsIHBvcyA9IEVOVElUWS5HRVRfRU5USVRZX0NPT1JEUyhQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSkKICAgICAgICAgICAgICAgIHBvcy56ID0gcG9zLnogKyAwLjk1ICAKICAgICAgICAgICAgICAgIGxvY2FsIHBvczEgPSBFTlRJVFkuR0VUX0VOVElUWV9DT09SRFMoUExBWUVSLkdFVF9QTEFZRVJfUEVEKHBpZCkpCiAgICAgICAgICAgICAgICBwb3MxLnogPSBwb3MxLnogLSAwLjkwCiAgICAgICAgICAgICAgICBsb2NhbCBjYWdlID0gdXRpbC5qb2FhdCgicHJvcF9mZWVkZXIxX2NyIikKICAgICAgICAgICAgICA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lq654mp5Lye5bSpVjEiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgcGVkX3VibF9jcmFzaHYxKCkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS5hY3Rpb24oYWxsX2NyYXNoLCLkurrniankvJ7ltKlWMiIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBwZWRfdWJsX2NyYXNodjIoKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbihhbGxfY3Jhc2gsIuS6uueJqeS8nuW0qVYzIix7fSwiIixmdW5jdGlvbigpCiAgICAgICAgICAgIHBlZF91YmxfY3Jhc2h2MygpCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUuYWN0aW9uKGFsbF9jcmFzaCwi5Lq654mp5Lye5bSpVjQiLHt9LCIiLGZ1bmN0aW9uKCkKICAgICAgICAgICAgcGVkX3VibF9jcmFzaHY0KCkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS5hY3Rpb24oYWxsX2NyYXNoLCJDQVJHT+W0qea6gyIse30sIuW0qea6g+aJgOacieeOqeWutiIsZnVuY3Rpb24oKQogICAgICAgICAgICBDQVJHTygpCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUuYWN0aW9uKGFsbF9jcmFzaCwgIuWkp+iHqueEtuWFqOWxgOW0qea6gyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBuYXR1cmUoKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbihhbGxfY3Jhc2gsICLmh4Llk6XltKnmuoMiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgZG9uZ2dlX2NyYXNoKCkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS5hY3Rpb24oYWxsX2NyYXNoLCAi5YWo5bGA6aG25bSpIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIHVua25vd24oKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbihhbG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IGRvCiAgICAgICAgICAgICAgICBsb2NhbCBjYXIgPSBQRUQuR0VUX1ZFSElDTEVfUEVEX0lTX0lOKFBMQVlFUi5HRVRfUExBWUVSX1BFRF9TQ1JJUFRfSU5ERVgoUExBWUVSLlBMQVlFUl9JRCgpKSwgdHJ1ZSkKICAgICAgICAgICAgICAgIGlmIGNhciB+PSAwIHRoZW4KICAgICAgICAgICAgICAgICAgICByZXF1ZXN0X2NvbnRyb2woY2FyKQogICAgICAgICAgICAgICAgICAgIFZFSElDTEUuU0VUX1ZFSElDTEVfTlVNQkVSX1BMQVRFX1RFWFQoY2FyLCBjYXJfY2FyZFtpXSkKICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICAgdXRpbC55aWVsZCgxMDApCiAgICAgICAgICAgIGVuZAogICAgICAgICAgICB1dGlsLnlpZWxkKDIwMCkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcChzZXRfc2VsZl9saWNlbnNlLCAi6YCf5bqm6L2m54mMIiwge30sICLmmL7npLrpgJ/luqYiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIGxvY2FsIGNhciA9IFBFRC5HRVRfVkVISUNMRV9QRURfSVNfSU4oUExBWUVSLkdFVF9QTEFZRVJfUEVEX1NDUklQVF9JTkRFWChQTEFZRVIuUExBWUVSX0lEKCkpLCB0cnVlKQogICAgICAgICAgICBpZiBjYXIgfj0gMCB0aGVuCiAgICAgICAgICAgICAgICBsb2NhbCBzcGVlZGUgPSBFTlRJVFkuR0VUX0VOVElUWV9TUEVFRChjYXIpICogMy42CiAgICAgICAgICAgICAgICBsb2NhbCBteXNwZWVkID0gbWF0aC5jZWlsKHNwZWVkZSkKICAgICAgICAgICAgICAgIFZFSElDTEUuU0VUX1ZFSElDTEVfTlVNQkVSX1BMQVRFX1RFWFQoY2FyLCBteXNwZWVkLi4iIGttaCIpCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgIAogICAgbWVudS50b2dnbGVfb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1bmN0aW9uKG9uKQogICAgICAgIGRyaXZlb25haXIgPSBvbgogICAgICAgIGlmIG9uIHRoZW4KICAgICAgICAgICAgbG9jYWwgcG9zID0gcGxheWVycy5nZXRfcG9zaXRpb24oUExBWUVSLlBMQVlFUl9JRCgpKQogICAgICAgICAgICBkb2FfaHQgPSBwb3NbJ3onXQogICAgICAgICAgICBub3RpZmljYXRpb24oIn55fn5ib2xkfuS9v+eUqOepuuagvOmUruWSjGN0cmzplK7lvq7osIPpqb7pqbbpq5jluqYhIiwgSHVkQ29sb3VyLmJsdWUpCiAgICAgICAgICAgIGlmIGRyaXZlb253YXRlciBvciB3YWxrb253YXRlciB0aGVuCiAgICAgICAgICAgICAgICBtZW51LnNldF92YWx1ZShsc19kcml2ZW9ud2F0ZXIsIGZhbHNlKQogICAgICAgICAgICAgICAgbWVudS5zZXRfdmFsdWUobHNfd2Fsa3dhdGVyLCBmYWxzZSkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKHZlaF9tb3ZlbWVudCwgIuawtOS4i+mpvumptiIsIHt9LCAiIiwgZnVuY3Rpb24gKCkKICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoIndhdGVyd2hlZWxzIikKICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlX2xvb3AodmVoX21vdmVtZW50LCAi6L295YW35bmz56e7Iiwge30sICLkvb/nlKjlt6blj7Pnrq3lpLTplK7kvb/ovabovobmsLTlubPnp7vliqgiLCBmdW5jdGlvbih0b2dnbGUpCiAgICAgICAgbG9jYWwgcGxheWVyX2N1cl9jYXIgPSBlbnRpdGllcy5nZXRfdXNlcl92ZWhpY2xlX2FzX2hhbmRsZSgpCiAgICAgICAgaWYgcGxheWVyX2N1cl9jYXIgfj0gMCB0aGVuCiAgICAgICAgICAgIGxvY2FsIHJvdCA9IEVOVElUWS5HRVRfRU5USVRZX1JPVEFUSU9OKHBsYXllcl9jdXJfY2F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HMpCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlKHZlaGZseXJvb3QsICfml6DnorDmkp4nLCB7fSwgJ+mjnuihjOaXtuemgeatouS4juWFtuS7lueJqeS9k+S6p+eUn+eisOaSnicsIGZ1bmN0aW9uIChvbikKICAgICAgICAgICAgdmVoX2ZseV9jb2xsKG9uKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZSh2ZWhmbHlyb290LCAn56aB55So5YGc5q2iJywge30sICfmlL7lvIDmjInplK7lkI7npoHmraLlgZzmraLovb3lhbcnLCBmdW5jdGlvbiAob24pCiAgICAgICAgICAgIHZlaF9mbHlfc3RvcChvbikKICAgICAgICBlbmQpCgp2ZWhfVUkgPSBtZW51Lmxpc3QodmVoaWNsZSwgJ+i9veWFt1VJJywge30sICcnKQogICAgbWVudS50b2dnbGVfbG9vcCh2ZWhfVUksICLnu5jliLbml7bpgJ8iLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICBzcGVlZGluZm8oKQogICAgZW5kKQogICAgVmVoX0FSX0dQUyA9IG1lbnUubGlzdCh2ZWhfVUksICdBUuWvvOiIqicsIHt9LCAnJykKICAgICAgICByZXF1aXJlICJsaWIuU2FrdXJhU2NyaXB0LkFyR3BzIgoKICAgIHNwZWVkb21ldGVyX2NhciA9IG1lbnUubGlzdCh2ZWhfVUksICLpgJ/luqbooagiLCB7fSwgIiIpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcChzcGVlZG9tZXRlcl9jYXIsICflvIDlkK8nLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgc3BlZWRvbWV0ZXIoKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmRpdmlkZXIoc3BlZWRvbWV0ZXJfY2FyLCAi5L2N572uIikKICAgICAgICBtZW51LnNsaWRlcihzcGVlZG9tZXRlcl9jYXIsICLkvY3nva5YIiwgeyJzcFgifSwgIiIsIDEsIDEwMCwgODQsIDEsIGZ1bmN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dmVoaWNsZV9hc19oYW5kbGUoKQogICAgICAgICAgICBBVURJTy5TRVRfSE9STl9FTkFCTEVEKHZlaGljbGUsIGZhbHNlKQogICAgICAgIGVuZCwgZnVuY3Rpb24oKQogICAgICAgICAgICBsb2NhbCB2ZWhpY2xlID0gZW50aXRpZXMuZ2V0X3VzZXJfdmVoaWNsZV9hc19oYW5kbGUoKQogICAgICAgICAgICBBVURJTy5TRVRfSE9STl9FTkFCTEVEKHZlaGljbGUsIHRydWUpCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKHZlaF9hY3Rpb24sICLoh6rliqjnv7vovawiLCB7fSwgIuWmguaenOS9oOeahOi9pui+humioOWAkuaIluS+p+mdouWwhuiHquWKqOe/u+i9rOWbnuatoyIsIGZ1bmN0aW9uKCkKICAgICAgICB2ZWhpY2xlX2F1dG9tYXRpY2FsbHkoKQogICAgZW5kKQoKCnZlaGljbGVXZWFwb25Sb290ID0gbWVudS5saXN0KHZlaGljbGUsICLovb3lhbfmrablmagiLCB7fSwgIiIpCiAgICBtZW51LnRvZ2dsZV9sb29wKHZlaGljbGVXZWFwb25Sb290LCAi55u05Y2H5py66Ieq5Yqo556E5YeG5ZmoIiwge30sICLorqnnm7TljYfmnLrnnoTlh4bmnIDov5HnmoTnjqnlrrYs6YCC55So5LqO6aOe5py677yM5L2G5pWI5p6c5LiN5aW9XG7lvZPnnoTlh4blsLHnu6rml7bpgJrov4fpvKDmoIflj7PplK5vcuepuuagvOinpuWPkSIsIGZ1bmN0aW9uICgpCiAgICAgICAgaGVsaWNvcHRlcl9hdXRvbWF0aWNfc2lnaHQoKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcCh2ZWhpY2xlV2VhcG9uUm9vdCwgIui9veWFt+WvvOW8ueiHqueehCIsIHt9LCAi5b2T546p5a625Zyo5Y+v6KeG6IyD5Zu05YaF5Y+R5bCE5a+85by56Ieq5Yqo6ZSB5a6a546p5a62IiwgZnVuY3Rpb24oKQogICAgICAgIHZlaF9taXNzaWxlX2FpbWJpdCgpCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKHZlaGljbGVXZWFwb25Sb290LCAi6L295YW35b+r6YCf5bCE5Ye7Iiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgbG9jYWwgdmVoaWNsZSA9IFBFRC5HRVRfVkVISUNMRV9QRURfSVNfVVNJTkcoUExBWUVSLlBMQVlFUl9QRURfSUQoKSkKICAgICAgICByZXF1ZXN0X2NvbnRyb2wodmVoaWNsZSkKICAgICAgICBWRUhJQ0xFLlNFVF9WRUhJQ0xFX0ZJWEVEKHZlaGljbGUpCiAgICAgICAgVkVISUNMRS5TRVRfVkVISUNMRV9ERUZPUk1BVElPTl9GSVhFRCh2ZWhpY2xlKQogICAgICAgIHV0aWwueWllbGQoNTApCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKHZlaGljbGVXZWFwb25Sb290LCAi5ZaH5Y+t54iG54K4Iiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgaG9ybl9ib21iKCkKICAgIGVuZCkKICAgIHZlaGljbGVXZWFwb25taXNzaWxlID0gbWVudS5saXN0KHZlaGljbGVXZWFwb25Sb290LCAi6L295YW35a+85by5Iiwge30sICIiKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AodmVoaWNsZVdlYXBvbm1pc3NpbGUsICLovb3lhbflr7zlvLkiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgdmVod2VhcG9uX3ZlaCgpCiAgICAgICAgZW5kLCBmdW5jdGlvbiAoKSAKICAgICAgICAgICAgVndfc3RhdGUgPSAwIAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKHZlaGljbGVXZWFwb25taXNzaWxlLCAi6L295YW35r+A5YWJIiwge30sICIiLCBmdW5jdGlvbiAoKQogICAgICAgICAgICB2ZWhsYXNlcigpCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUubGlzdF9zZWxlY3QodmVoaWNsZVdlYXBvbm1pc3NpbGUsICLorr7nva7ovb3lhbfmrablmagiLCB7fSwgIiIsIHZlaHdlYXBvbl9uYW1lLCAxLCBmdW5jdGlvbiAodmFsdWUsIG1lbnVfbmFtZSwgcHJldl92YWx1ZSwgY2xpY2tfdHlwZSkKICAgICAgICAgICAgc2V0dmVod2VhcG9uKHZhbHVlLCBtZW51X25hbWUsIHByZXZfdmFsdWUsIGNsaWNrX3R5cGUpCiAgICAgICAgZW5kKQogICAgICAgIHZlaGljbGVXZWFwb25zQ29udHJvbCA9IG1lbnUubGlzdCh2ZWhpY2xlV2VhcG9ubWlzc2lsZSwgIuabtOaUueaMiemUriIsIHt9LCAiIikKICAgICAgICAgICAgZm9yIG5hbWUsIGNvbnRyb2wgaW4gcGFpcnMoSW1wdXRzX3ZlaHdlYXBvbikgZG8KICAgICAgICAgICAgICAgIGxvY2FsIGtleWJvYXJkLCBjb250cm9sbGVyID0gY29udHJvbFsxXTptYXRjaCgnXiguKyklcz87JXM/KC4rKSQnKQogICAgICAgICAgICAgICAgbG9jYWwgc3RyZyA9ICgiJXM6ICVzLCAlczogJXMiKTpmb3JtYXQodHJhbnNfcGxhbmUuS2V5Ym9hcmQsIGtleWJvYXJkLCB0cmFuc19wbGFuZS5Db250cm9sbGVyLCBjb250cm9sbGVyKQogICAgICAgICAgICAgICAgbWVudS5hY3Rpb24odmVoaWNsZVdlYXBvbnNDb250cm9sLCBzdHJnLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgICAgICBmdW5Db25maWcuY29udHJvbHMudmVoaWNsZXdlYXBvbnMgPSBjb250cm9sWzJdCiAgICAgICAgICAgICAgICAgICAgdXRpbC5zaG93X2Nvcm5lcl9oZWxwKHRyYW5zX3BsYW5lLlZlaGljbGVXZWFwb25zOmZvcm1hdChuYW1lKSkKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgZW5kCiAgICBsaXN0X2hvbWluZ01pc3Np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zZSkKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKENheW9fcG9zaXRpb24sICLmnLrlnLoo6YCD56a7KSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIHRlbGVwb3J0KDQ0NDMuMTg5LCAtNDUxMC4yNzksIDQuODk4NTM5LCB0cnVlKQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oQ2F5b19wb3NpdGlvbiwgIuS8oOmAgeWIsOWkp+a1tyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIHdoaWxlIG5vdCBDVVRTQ0VORS5JU19DVVRTQ0VORV9QTEFZSU5HKCkgZG8KICAgICAgICAgICAgICAgICAgICAgICAgdGVsZXBvcnQoMzIzNSwgLTQ5MzgsIDU2LCB0cnVlKQogICAgICAgICAgICAgICAgICAgICAgICB1dGlsLnlpZWxkKDIwMCkKICAgICAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbG9jYWwgQ2F5b19zZXR0aW5nID0gbWVudS5saXN0KENheW9fbGlzdCwgIuS7u+WKoeiuvuWumiIsIHt9LCAiIikKICAgICAgICAgICAgICAgIGxvY2FsIENheW9fZGVmYXVsdCA9IG1lbnUubGlzdChDYXlvX3NldHRpbmcsICLku7vliqHpooTorr4iLCB7fSwgIiIpCiAgICAgICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oQ2F5b19kZWZhdWx0LCAi5a6M5oiQ5YmN572u5Lu75YqhIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRDTkZfVEFSR0VUIiwgNSktLeS4u+imgeebruaghwogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0X01JU1NJT05TIiwgLTEpLS3op6PplIHmiYDmnInmjqXov5Hovb3lhbcKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINF9QUk9HUkVTUyIsIDEyNjgyMyktLemavuW6pjrmraPluLgKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINENORl9BUFBST0FDSCIsIC0xKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0Q05GX0JTX0VOVFIiLCA2MykKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINENORl9CU19HRU4iLCA2MykKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINENORl9XRVBfRElTUlAiLCAzKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0Q05GX0FSTV9ESVNSUCIsIDMpCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRDTkZfSEVMX0RJU1JQIiwgMykKCiAgICAgICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfTE9DQUwoImhlaXN0X2lzbGFuZF9wbGFubmluZyIsIDE1NDYsIDIpCiAgICAgICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKENheW9fZGVmYXVsdCwgIumHjee9rumdouadvyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0X01JU1NJT05TIiwgMCkgLS1sb2NrZWQKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINF9QUk9HUkVTUyIsIDApIC0tbG9ja2VkCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRDTkZfQVBQUk9BQ0giLCAwKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0Q05GX0JTX0VOVFIiLCAwKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0Q05GX0JTX0dFTiIsIDApCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRfUExBWVRIUk9VR0hfU1RBVFVTIiwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINENORl9UQVJHRVQiLCAtMSkKICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfTE9DQUwoImhlaXN0X2lzbGFuZF9wbGFubmluZyIsIDE1NDYsIDIpCiAgICAgICAgICAgICAgICAgICAgZW5kKQoKICAgICAgICAgICAgICAgIG1lbnUudGV4dHNsaWRlcihDYXlvX3NldHRpbmcsICLkuLvopoHnm67moIciLCB7fSwgIiIsIHsi6b6Z6IiM5YWw5YWw6YWSIiwi57qi5a6d55+z6aG56ZO+Iiwi5LiN6K6w5ZCN5YC65Yi4Iiwi57KJ6ZK7Iiwi546b5b635ouJ57Si5paH5Lu2Iiwi54yO6LG56ZuV5YOPIn0sIGZ1bmN0aW9uIChpbmRleCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0Q05GX1RBUkdFVCIsIGluZGV4IC0gMSkKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0xPQ0FMKCJoZWlzdF9pc2xhbmRfcGxhbm5pbmciLCAxNTQ2LCAyKQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oQ2F5b19zZXR0aW5nLCAi5qyh6KaB55uu5qCHIiwge30sICLmt7flkIjmiYDmnInmrKHopoHnm67moIciLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINExPT1RfQ0FTSF9JIiwgMTMxOTYyNCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9DQVNIX0MiLCAxOCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9DQVNIX1YiLCA4OTQwMCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9XRUVEX0kiLCAyNjM5MTA4KQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRMT09UX1dFRURfQyIsIDM2KQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRMT09UX1dFRURfViIsIDE0OTAwMCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9DT0tFX0kiLCA0MjI5MTIyKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRMT09UX0NPS0VfQyIsIDcyKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRMT09UX0NPS0VfViIsIDIyMTIwMCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9HT0xEX0kiLCA4NTg5MzEzKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRMT09UX0dPTERfQyIsIDEyOSkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9HT0xEX1YiLCAzMjI2MDApCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINExPT1RfUEFJTlQiLCAxMjcpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINExPT1RfUEFJTlRfViIsIDE4NjgwMCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9DQVNIX0lfU0NPUEVEIiwgMTMxOTYyNCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9DQVNIX0NfU0NPUEVEIiwgMTgpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINExPT1RfV0VFRF9JX1NDT1BFRCIsIDI2MzkxMDgpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJINExPT1RfV0VFRF9DX1NDT1BFRCIsIDM2KQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRMT09UX0NPS0VfSV9TQ09QRUQiLCA0MjI5MTIyKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRMT09UX0NPS0VfQ19TQ09QRUQiLCA3MikKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9HT0xEX0lfU0NPUEVEIiwgODU4OTMxMykKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0TE9PVF9HT0xEX0NfU0NPUEVEIiwgMTI5KQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRMT09UX1BBSU5UX1NDT1BFRCIsIDEyNykKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUudGV4dHNsaWRlcihDYXlvX3NldHRpbmcsICLmrablmajoo4XlpIciLCB7fSwgIiIsIHsi5L6155Wl6ICFIiwgIumYtOiwi+iAhSIsICLnpZ7mnqrmiYsiLCAi56C05Z2P6ICFIiwgIuelnuWwhOaJiyJ9LCBmdW5jdGlvbihpbmRleCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0Q05GX1dFQVBPTlMiLCBpbmRleCkKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0xPQ0FMKCJoZWlzdF9pc2xhbmRfcGxhbm5pbmciLCAxNTQ2LCAyKQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS50ZXh0c2xpZGVyKENheW9fc2V0dGluZywgIuaKouWKq+mavuW6piIsIHt9LCAiIiwgeyLmraPluLgiLCLlm7Dpmr4ifSwgZnVuY3Rpb24oSW5kZXgpCiAgICAgICAgICAgICAgICAgICAgaWYgSW5kZXggPT0gMSB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDRfUFJPR1JFU1MiLCAxMjY4MjMpIC0tbG9ja2VkCiAgICAgICAgICAgICAgICAgICAgZWxzZWlmIEluZGV4ID09IDIgdGhlbgogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkg0X1BST0dSRVNTIiwgMTMxMDU1KQogICAgICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfTE9DQUwoImhlaXN0X2lzbGFuZF9wbGFubmluZyIsIDE1NDYsIDIpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LmFjdGlvbihDYXlvX3NldHRpbmcsICLliLfmlrDku7vliqHpnaLmnb8iLCB7fSwgIiIsIGZ1bmN0aW9uKCktLVVwZGF0ZSB0YWcoMS42OSkKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0xPQ0FMKCJoZWlzdF9pc2xhbmRfcGxhbm5pbmciLCAxNTQ2LCAyKS0tLS0tLS3liLfmlrAoaHR0cHM6Ly9naXRodWIuY29tL1RDUm9pZC9TdGFuZC1MdWEtUlMtTWlzc2lvbnMvYmxvYi9tYWluL2xpYi9SU19NaXNzaW9ucy92YXJpYWJsZXMubHVhI0wzOTcpCiAgICAgICAgICAgICAgICBlbmQpCgoKICAgICAgICAgICAgbG9jYWwgQ2F5b19jdXQgPSBtZW51Lmxpc3QoQ2F5b19saXN0LCAi5YiG57qi6LCD5pW0Iiwge30sICLliIbnuqLnlYzpnaLlh7rnjrDml7blho3kv67mlLkiKS0t5L2p6YeM56eR5bKbCiAgICAgICAgICAgICAgICBsb2NhbCBjYXlvX2N1dF9wID0gbWVudS5saXN0KENheW9fY3V0LCAi546p5a62WzEtNF0iLCB7fSwgIiIpCiAgICAgICAgICAgICAgICAgICAgbWVudS5jbGlja19zbGlkZXIoY2F5b19jdXRfcCwgIueOqeWutjEiLCB7fSwgIiglKSIsIDAsIDEwMDAsIDI1LCA1LCBmdW5jdGlvbih2YWx1ZSkKICAgICAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9HTE9CQUwoR2xvYmFsX0Jhc2UuQ2F5b19jdXQgKyA4MzEgKyA1NiArIDEsIHZhbHVlKQogICAgICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgICAgICBtZW51LmNsaWNrX3NsaWRlcihjYXlvX2N1dF9wLCAi546p5a62MiIsIHt9LCAiKCUpIiwgMCwgMTAwMCwgMjUsIDUsIGZ1bmN0aW9uKHZhbHVlKQogICAgICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0dMT0JBTChHbG9iYWxfQmFzZS5DYXlvX2N1dCArIDgzMSArIDU2ICsgMiwgdmFsdWUpCiAgICAgICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgICAgIG1lbnUuY2xpY2tfc2xpZGVyKGNheW9fY3V0X3AsICLnjqnlrrYzIiwge30sICIoJSkiLCAwLCAxMDAwLCAyNSwgNSwgZnVuY3Rpb24odmFsdWUpCiAgICAgICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKEdsb2JhbF9CYXNlLkNheW9fY3V0ICsgODMxICsgNTYgKyAzLCB2YWx1ZSkKICAgICAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICAgICAgbWVudS5jbGlja19zbGlkZXIoY2F5b19jdXRfcCwgIueOqeWutjQiLCB7fSwgIiglKSIsIDAsIDEwMDAsIDI1LCA1LCBmdW5jdGlvbih2YWx1ZSkKICAgICAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9HTE9CQUwoR2xvYmFsX0Jhc2UuQ2F5b19jdXQgKyA4MzEgKyA1NiArIDQsIHZhbHVlKQogICAgICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKENheW9fY3V0LCAi6Ieq5L+d5YiG57qiIiwge30sICLlhajlkZgxMzUlLOiHquW3sTYwJSIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgIC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ogICAgICAgICAgICAgICAgaWYgSVNfSEVMUF9NU0dfRElTUExBWUVEKCJVVF9XRUxEX1BST01QVCIpIHRoZW4gCiAgICAgICAgICAgICAgICAgICAgUEFEMi5fU0VUX0NPTlRST0xfTk9STUFMKDIsIDUxLCAxKQogICAgICAgICAgICAgICAgZWxzZWlmIEdFVF9JTlRfTE9DQUwoImZtX21pc3Npb25fY29udHJvbGxlcl8yMDIwIiwgMjY3NDYpID09IDQgdGhlbiAKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0xPQ0FMKCJmbV9taXNzaW9uX2NvbnRyb2xsZXJfMjAyMCIsIDI2NzQ2LCA2KQogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS5hY3Rpb24oQ2F5b19saXN0LCAi5Yig6Zmk5o6S5rC0566hIiwge30sICIiLCBmdW5jdGlvbigpIAogICAgICAgICAgICAgICAgREVMRVRFX09CSkVDVF9CWV9IQVNIKC0xMjk3NjM1OTg4KQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoQ2F5b19saXN0LCAi6Lez6L+H5oyH57q56ZSBIiwge30sICIiLCBmdW5jdGlvbigpIC0tVXBkYXRlIHRhZygxLjY5KQogICAgICAgICAgICAgICAgaWYgR0VUX0lOVF9MT0NBTCgiZm1fbWlzc2lvbl9jb250cm9sbGVyXzIwMjAiLCAyNDg4MCkgPT0gNCB0aGVuIC0tIGh0dHBzOi8vd3d3LnVua25vd25jaGVhdHMubWUvZm9ydW0vMzQxODkxNC1wb3N0MTMzOTguaHRtbAogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfTE9DQUwoImZtX21pc3Npb25fY29udHJvbGxlcl8yMDIwIiwgMjQ4ODAsIDUpCiAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBtZW51LmFjdGlvbihDYXlvX2xpc3QsICLot7Pov4fliIflibLnjrvnkoMiLCB7fSwgIuWIh+WJsuaXtuS9v+eUqCIsIGZ1bmN0aW9uKCktLVVwZGF0ZSB0YWcoMS42OSkKICAgICAgICAgICAgICAgICAgICBTRVRfRkxPQVRfTE9DQUwoImZtX21pc3Npb25fY29udHJvbGxlcl8yMDIwIiwgMzA5MzkgKyAzLCAxMDApCiAgICAgICAgICAgICAgICBlbmQsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgICAgICBTRVRfRkxPQVRfTE9DQUwoImZtX21pc3Npb25fY29udHJvbGxlcl8yMDIwIiwgMzA5MzkgKyAzLCAwKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoQ2F5b19saXN0LCAi57uV6L+H5YiH5Ymy5py65Y+R54OtIiwge30sICLliIflibLliY3lvIDlkK8iLCBmdW5jdGlvbigpLS1VcGRhdGUgdGFnKDEuNjkpCiAgICAgICAgICAgICAgICBTRVRfRkxPQVRfTE9DQUwoImZtX21pc3Npb25fY29udHJvbGxlcl8yMDIwIiwgMzA5MzkgKyA0LCAwKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUuYWN0aW9uKENheW9fbGlzdCwgIuadgOatu+mYn+WPiyIsIHt9LCAi54K45q276Zif5Y+LKOaXoOaVjOWPr+WFjeeWqykiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBmb3IgaywgcGlkIGluIHBhaXJzKHBsYXllcnMubGlzdChmYWxzZSwgdHJ1ZSwgdHJ1ZSkpIGRvCiAgICAgICAgICAgICAgICAgICAga2lsbF9wbGF5ZXIocGlkKQogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIGVuZCkKCiAgICAgICAgICAgIGxvY2FsIENheW9fc2VuaW9yID0gbWVudS5saXN0KENheW9fbGlzdCwgIumrmOe6p+mAiemhuSIsIHt9LCAiIiktLeS9qemHjOenkeWymwogICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oQ2F5b19zZW5pb3IsICLlvLrliL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/lrozmiJAiLCB7fSwgIuehruS/neS9oOaYr+S7u+WKoeiEmuacrOS4u+acuiIsIGZ1bmN0aW9uKCktLVVwZGF0ZSB0YWcoMS42OSkKICAgICAgICAgICAgICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoInNjcmlwdGhvc3QiKQogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfTE9DQUwoImZtX21pc3Npb25fY29udHJvbGxlcl8yMDIwIiwgNTAxNTAsIDkpIC0tICdmbV9taXNzaW9uX2NvbnRyb2xsZXJfMjAyMCcgaW5zdGFudCBmaW5pc2ggdmFyaWFibGU/CiAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9MT0NBTCgiZm1fbWlzc2lvbl9jb250cm9sbGVyXzIwMjAiLCA1MDE1MCArIDE3NzAgKyAxLCA1MCkgLS0gJ2ZtX21pc3Npb25fY29udHJvbGxlcl8yMDIwJyBpbnN0YW50IGZpbmlzaCB2YXJpYWJsZT8KICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgCiAgICAgICAgLS3otYzlnLrpgInpobkKICAgICAgICBsb2NhbCBjYXNpbm9fbGlzdCA9IG1lbnUubGlzdChIZWlzdENvbnRyb2xMaXN0LCAi5ZCN6ZK76LWM5Zy6Iiwge30sICIiKQogICAgICAgICAgICBsb2NhbCBjYXNpbm9fc2V0dGluZyA9IG1lbnUubGlzdChjYXNpbm9fbGlzdCwgIuS7u+WKoeiuvuWumiIsIHt9LCAiIikKICAgICAgICAgICAgICAgIGxvY2FsIGNhc2lub19kZWZhdWx0ID0gbWVudS5saXN0KGNhc2lub19zZXR0aW5nLCAi5Lu75Yqh6aKE6K6+Iiwge30sICIiKQogICAgICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNhc2lub19kZWZhdWx0LCAi5a6M5oiQ5YmN572u5Lu75YqhIiwge30sICLnm67moIfvvJrpkrvnn7NcbuaWueW8jzrmsJTlir/msbnmsbkiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiQ0FTX0hFSVNUX0ZMT1ciLCAtMSkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM19MQVNUX0FQUFJPQUNIIiwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9BUFBST0FDSCIsIDMpCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNfSEFSRF9BUFBST0FDSCIsIDApCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNPUFRfVEFSR0VUIiwgMykKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9QT0kiLCAxMDIzKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX0FDQ0VTU1BPSU5UUyIsIDIwNDcpCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNPUFRfQ1JFV1dFQVAiLCA0KQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX0NSRVdEUklWRVIiLCAzKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX0NSRVdIQUNLRVIiLCA0KQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX0RJU1JVUFRTSElQIiwgMykKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9CT0RZQVJNT1JMVkwiLCAtMSkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9LRVlMRVZFTFMiLCAyKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX0JJVFNFVDEiLCA3OTkpCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNPUFRfQklUU0VUMCIsIDM2NzAxMDIpCiAgICAgICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNhc2lub19kZWZhdWx0LCAi6YeN572u6Z2i5p2/Iiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNfTEFTVF9BUFBST0FDSCIsIDApCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNPUFRfQVBQUk9BQ0giLCAwKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzX0hBUkRfQVBQUk9BQ0giLCAwKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX1RBUkdFVCIsIDApCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNPUFRfUE9JIiwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9BQ0NFU1NQT0lOVFMiLCAwKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX0JJVFNFVDEiLCAwKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX0NSRVdXRUFQIiwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9DUkVXRFJJVkVSIiwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9DUkVXSEFDS0VSIiwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9XRUFQUyIsIDApCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNPUFRfVkVIUyIsIDApICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9ESVNSVVBUU0hJUCIsIDApCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNPUFRfQk9EWUFSTU9STFZMIiwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9LRVlMRVZFTFMiLCAwKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX01BU0tTIiwgMCkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9CSVRTRVQwIiwgMCkKICAgICAgICAgICAgICAgICAgICBlbmQpCgogICAgICAgICAgICAgICAgbWVudS50ZXh0c2xpZGVyKGNhc2lub19zZXR0aW5nLCAi6YCJ5oup5pa55byPIiwge30sICLkvaDlj6/og73pnIDopoHliLfmlrDpnaLmnb8iLCB7IumakOi/uea9nOi4qiIsIuWFteS4jeWOjOiviCIsIuawlOWKv+axueaxuSJ9LCBmdW5jdGlvbiAoaW5kZXgpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM19MQVNUX0FQUFJPQUNIIiwgMCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX0FQUFJPQUNIIiwgaW5kZXgpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LnRleHRzbGlkZXIoY2FzaW5vX3NldHRpbmcsICLpgInmi6npmr7luqYiLCB7fSwgIuS9oOWPr+iDvemcgOimgeWIt+aWsOmdouadvyIsIHsi5q2j5bi4Iiwi5Zuw6Zq+In0sIGZ1bmN0aW9uIChpbmRleCkKICAgICAgICAgICAgICAgICAgICBpZiBpbmRleCA9PSAxIHRoZW4KICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM19IQVJEX0FQUFJPQUNIIiwgMCkKICAgICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgICAgIGZvciBpID0gMSwgMyBkbwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgU1RBVF9HRVRfSU5UKCJIM09QVF9BUFBST0FDSCIpID09IGkgdGhlbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSDNfSEFSRF9BUFBST0FDSCIsIGkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LnRleHRzbGlkZXIoY2FzaW5vX3NldHRpbmcsICLpgInmi6nnm67moIciLCB7fSwgIuS9oOWPr+iDvemcgOimgeWIt+aWsOmdouadvyIsIHsi546w6YeRIiwi6buE6YeRIiwi6Im65pyv5L2c5ZOBIiwi6ZK755+zIn0sIGZ1bmN0aW9uIChpbmRleCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX1RBUkdFVCIsIGluZGV4IC0gMSkKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNhc2lub19zZXR0aW5nLCAi5Yi35paw5Lu75Yqh6Z2i5p2/Iiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9CSVRTRVQwIiwgbWF0aC5yYW5kb20oSU5UX01BWCkpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJIM09QVF9CSVRTRVQxIiwgbWF0aC5yYW5kb20oSU5UX01BWCkpCiAgICAgICAgICAgICAgICAgICAgdXRpbC55aWVsZF9vbmNlKCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkgzT1BUX0JJVFNFVDAiLCBTVEFUX0dFVF9JTlQoIkgzT1BUX0JJVFNFVDAiKSkKICAgICAgICAgICAgICAgICAgICBT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A3LjIzNywgNDEuNDk0LCA4MC4xODcsIGZhbHNlKQogICAgICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNhc2lub19wb3NpdGlvbiwgIui9puW6k+WHuuWPoyjmuLjmiI/ljoUpIiwge30sICLlhYjov5vmuLjmiI/ljoUiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgdGVsZXBvcnQoMjY3Ny4yMzcsIC0zNjEuNDk0LCAtNTUuMTg3LCBmYWxzZSkKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNhc2lub19wb3NpdGlvbiwgIuS4i+awtOmBkyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIHRlbGVwb3J0KDk5My4yMSwgLTE0Ni4yMSwgMzQuNTksIHRydWUpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LmFjdGlvbihjYXNpbm9fcG9zaXRpb24sICLpl6jlj6Mo6LWM5Zy6KSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIHRlbGVwb3J0KDkxNy4yNDYzNCwgNDguOTg5NTY3LCA4MC44OTg5MiwgdHJ1ZSkKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNhc2lub19wb3NpdGlvbiwgIuWRmOW3peWkp+WOhSjotYzlnLopIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgdGVsZXBvcnQoOTY1LjE0ODU2LCAtOS4wNTAyMywgODAuNjMwNDUsIGZhbHNlKQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oY2FzaW5vX3Bvc2l0aW9uLCAi6Z+z5LmQ5p+cIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgdGVsZXBvcn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IHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIHRlbGVwb3J0KDI0OTcuNTA5OCwgLTIzOC41MDc2OCwgLTcwLjczODgsIHRydWUpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LmFjdGlvbihjYXNpbm9fcG9zaXRpb24sIuWwj+mHkeW6kyjotYzlnLopIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgdGVsZXBvcnQoMjUyMC44NjQ1LCAtMjg2LjMwNjg1LCAtNTguNzIzMDA3LCB0cnVlKQogICAgICAgICAgICAgICAgZW5kKQoKICAgICAgICAgICAgbG9jYWwgQ2FzaW5vX2N1dCA9IG1lbnUubGlzdChjYXNpbm9fbGlzdCwgIuWIhue6ouiwg+aVtCIsIHt9LCAiIiktLei1jOWcugogICAgICAgICAgICAgICAgbG9jYWwgY2FzaW5vX2N1dF9wID0gbWVudS5saXN0KENhc2lub19jdXQsICLnjqnlrrZbMS00XSIsIHt9LCAiIikKICAgICAgICAgICAgICAgICAgICBtZW51LmNsaWNrX3NsaWRlcihjYXNpbm9fY3V0X3AsICLnjqnlrrYxIiwge30sICIoJSkiLCAwLCAxMDAwLCAyNSwgNSwgZnVuY3Rpb24odmFsdWUpCiAgICAgICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKEdsb2JhbF9CYXNlLkNhc2lub19DdXQgKyAxNDk3ICsgNzM2ICsgOTIgKyAxLCB2YWx1ZSkKICAgICAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICAgICAgbWVudS5jbGlja19zbGlkZXIoY2FzaW5vX2N1dF9wLCAi546p5a62MiIsIHt9LCAiKCUpIiwgMCwgMTAwMCwgMjUsIDUsIGZ1bmN0aW9uKHZhbHVlKQogICAgICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0dMT0JBTChHbG9iYWxfQmFzZS5DYXNpbm9fQ3V0ICsgMTQ5NyArIDczN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ikKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0dMT0JBTChHbG9iYWxfQmFzZS5DYXNpbm9fQ3V0ICsgMTQ5NyArIDczNiArIDkyICsgNCwgMTQ2KQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS5jbGlja19zbGlkZXIoQ2FzaW5vX2N1dCwgIuiHquWumuS5ieWIhue6oiIsIHt9LCAiKCUpIiwgMCwgMTAwMCwgMjUsIDUsIGZ1bmN0aW9uKHZhbHVlKQogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKEdsb2JhbF9CYXNlLkNhc2lub19DdXQgKyAxNDk3ICsgNzM2ICsgOTIgKyAxLCB2YWx1ZSkKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0dMT0JBTChHbG9iYWxfQmFzZS5DYXNpbm9fQ3V0ICsgMTQ5NyArIDczNiArIDkyICsgMiwgdmFsdWUpCiAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9HTE9CQUwoR2xvYmFsX0Jhc2UuQ2FzaW5vX0N1dCArIDE0OTcgKyA3MzYgKyA5MiArIDMsIHZhbHVlKQogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKEdsb2JhbF9CYXNlLkNhc2lub19DdXQgKyAxNDk3ICsgNzM2ICsgOTIgKyA0LCB2YWx1ZSkKICAgICAgICAgICAgICAgIGVuZCkKCiAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNhc2lub19saXN0LCAi5p2A5q276Zif5Y+LIiwge30sICLngrjmrbvpmJ/lj4so5peg5pWM5Y+v5YWN55arKSIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgIGZvciBrLCBwaWQgaW4gcGFpcnMocGxheWVycy5saXN0KGZhbHNlLCB0cnVlLCB0cnVlKSkgZG8KICAgICAgICAgICAgICAgICAgICBraWxsX3BsYXllcihwaWQpCiAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBsb2NhbCBDYXNpbm9fc2VuaW9yID0gbWVudS5saXN0KGNhc2lub19saXN0LCAi6auY57qn6YCJ6aG5Iiwge30sICIiKS0t6LWM5Zy6CiAgICAgICAgICAgICAgICBtZW51LmFjdGlvbihDYXNpbm9fc2VuaW9yLCAi5by65Yi25YeG5aSHIiwge30sICIiLCBmdW5jdGlvbigpIC0tVXBkYXRlIHRhZygxLjY5KQogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKDE5NjkyMTIgKyAxICsgKDEgKiA2OCkgKyA4ICsgMSwgMSkgLS0gVGhhbmtzIHRvIEB2aXRoaWFtIG9uIERpc2NvcmQKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0dMT0JBTCgxOTY5MjEyICsgMSArICgyICogNjgpICsgOCArIDIsIDEpIAogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKDE5NjkyMTIgKyAxICsgKDMgKiA2OCkgKyA4ICsgMywgMSkKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoQ2FzaW5vX3NlbmlvciwgIuiHquWKqOm8oOagh+W3pumUrueCueWHuyIsIHt9LCAi55So5LqO5ou/5Y+W55uu5qCH6LSi54mp5pe2IixmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgaWYgVEFTSy5HRVRfSVNfVEFTS19BQ1RJVkUoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgMTM1KSB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgIFBBRC5TRVRfQ09OVFJPTF9WQUxVRV9ORVhUX0ZSQU1FKDAsIDIzNywgMSkKICAgICAgICAgICAgICAgICAgICAgICAgdXRpbC55aWVsZCg1MCkKICAgICAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoQ2FzaW5vX3NlbmlvciwgIuWNleS6uuW8uuWItuW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ibGU/CiAgICAgICAgICAgICAgICBlbmQpCiAgICAtLeacq+aXpeixquadsAogICAgICAgIGxvY2FsIGRvb21zZGF5X2xpc3QgPSBtZW51Lmxpc3QoSGVpc3RDb250cm9sTGlzdCwgIuacq+aXpeixquadsCIsIHt9LCAiIikKICAgICAgICAgICAgbG9jYWwgZG9vbXNkYXlfc2V0dGluZyA9IG1lbnUubGlzdChkb29tc2RheV9saXN0LCAi5Lu75Yqh6K6+5a6aIiwge30sICIiKQogICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oZG9vbXNkYXlfc2V0dGluZywgIuaVsOaNruazhOmcsiBJIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJHQU5HT1BTX0ZMT1dfTUlTU0lPTl9QUk9HIiwgNTAzKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiR0FOR09QU19IRUlTVF9TVEFUVVMiLCAtMjI5MzgzKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiR0FOR09QU19GTE9XX05PVElGSUNBVElPTlMiLCAxNTU3KQogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfTE9DQUwoImdiX2dhbmdfb3BzX3BsYW5uaW5nIiwgMTg0LCA2KQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oZG9vbXNkYXlfc2V0dGluZywgIuazouagvOS4ueWNseacuiBJSSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiR0FOR09QU19GTE9XX01JU1NJT05fUFJPRyIsIDI0MCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkdBTkdPUFNfSEVJU1RfU1RBVFVTIiwgLTIyOTM3OCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkdBTkdPUFNfRkxPV19OT1RJRklDQVRJT05TIiwgMTU1NykKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0xPQ0FMKCJnYl9nYW5nX29wc19wbGFubmluZyIsIDE4NCwgNikKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKGRvb21zZGF5X3NldHRpbmcsICLmnKvml6XpmY3kuLQgSUlJIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJHQU5HT1BTX0ZMT1dfTUlTU0lPTl9QUk9HIiwgMTYzNjgpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJHQU5HT1BTX0hFSVNUX1NUQVRVUyIsIC0yMjkzODApCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJHQU5HT1BTX0ZMT1dfTk9USUZJQ0FUSU9OUyIsIDE1NTcpCiAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9MT0NBTCgiZ2JfZ2FuZ19vcHNfcGxhbm5pbmciLCAxODQsIDYpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LmFjdGlvbihkb29tc2RheV9zZXR0aW5nLCAi6YeN572u5Lu75Yqh6Z2i5p2/Iiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJHQU5HT1BTX0ZMT1dfTUlTU0lPTl9QUk9HIiwgMjQwKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiR0FOR09QU19IRUlTVF9TVEFUVVMiLCAwKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiR0FOR09QU19GTE9XX05PVElGSUNBVElPTlMiLCAxNTU3KQogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfTE9DQUwoImdiX2dhbmdfb3BzX3BsYW5uaW5nIiwgMTg0LCA2KQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICA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VlFUi5QTEFZRVJfUEVEX0lEKCksIC01MCkKICAgICAgICAgICAgICAgIGVuZCkKCiAgICAgICAgICAgIGxvY2FsIGRvb21zZGF5X2N1dCA9IG1lbnUubGlzdChkb29tc2RheV9saXN0LCAi5YiG57qi6K6+572uIiwge30sICIiKS0t5pyr5pelCiAgICAgICAgICAgICAgICBsb2NhbCBkb29tc2RheV9jdXRfcCA9IG1lbnUubGlzdChkb29tc2RheV9jdXQsICLnjqnlrrZbMS00XSIsIHt9LCAiIikKICAgICAgICAgICAgICAgICAgICBtZW51LmNsaWNrX3NsaWRlcihkb29tc2RheV9jdXRfcCwgIueOqeWutjEiLCB7fSwgIiglKSIsIDAsIDEwMDAsIDI1LCA1LCBmdW5jdGlvbih2YWx1ZSkKICAgICAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9HTE9CQUwoR2xvYmFsX0Jhc2UuRG9vbXNkYXlfQ3V0ICsgODEyICsgNTAgKyAxLCB2YWx1ZSkKICAgICAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICAgICAgbWVudS5jbGlja19zbGlkZXIoZG9vbXNkYXlfY3V0X3AsICLnjqnlrrYyIiwge30sICIoJSkiLCAwLCAxMDAwLCAyNSwgNSwgZnVuY3Rpb24odmFsdWUpCiAgICAgICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKEdsb2JhbF9CYXNlLkRvb21zZGF5X0N1dCArIDgxMiArIDUwICsgMiwgdmFsdWUpCiAgICAgICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgICAgIG1lbnUuY2xpY2tfc2xpZGVyKGRvb21zZGF5X2N1dF9wLCAi546p5a62MyIsIHt9LCAiKCUpIiwgMCwgMTAwMCwgMjUsIDUsIGZ1bmN0aW9uKHZhbHVlKQogICAgICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0dMT0JBTChHbG9iYWxfQmFzZS5Eb29tc2RheV9DdXQgKyA4MTIgKyA1MCArIDMsIHZhbHVlKQogICAgICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgICAgICBtZW51LmNsaWNrX3NsaWRlcihkb29tc2RheV9jdXRfcCwgIueOqeWutjQiLCB7fSwgIiglKSIsIDAsIDEwMDAsIDI1LCA1LCBmdW5jdGlvbih2YWx1ZSkKICAgICAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9HTE9CQUwoR2xvYmFsX0Jhc2UuRG9vbXNkYXlfQ3V0ICsgODEyICsgNTAgKyA0LCB2YWx1ZSkKICAgICAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LmNsaWNrX3NsaWRlcihkb29tc2RheV9jdXQsICLlhajlkZjliIbnuqIiLCB7fSwgIiglKSIsIDAsIDEwMDAsIDI1LCA1LCBmdW5jdGlvbih2YWx1ZSkKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0dMT0JBTChHbG9iYWxfQmFzZS5Eb29tc2RheV9DdXQgKyA4MTIgKyA1MCArIDEsIHZhbHVlKQogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKEdsb2JhbF9CYXNlLkRvb21zZGF5X0N1dCArIDgxMiArIDUwICsgMiwgdmFsdWUpCiAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9HTE9CQUwoR2xvYmFsX0Jhc2UuRG9vbXNkYXlfQ3V0ICsgODEyICsgNTAgKyAzLCB2YWx1ZSkKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0dMT0JBTChHbG9iYWxfQmFzZS5Eb29tc2RheV9DdXQgKyA4MTIgKyA1MCArIDQsIHZhbHVlKQogICAgICAgICAgICAgICAgZW5kKQoKICAgICAgICAgICAgbG9jYWwgZG9vbXNkYXlfc2VuaW9yID0gbWVudS5saXN0KGRvb21zZGF5X2xpc3QsICLpq5jnuqfpgInpobkiLCB7fSwgIiIpLS3mnKvml6UKICAgICAgICAgICAgICAgIG1lbnUuY2xpY2tfc2xpZGVyKGRvb21zZGF5X3Nlbml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JvbGxlciIsIDMxNjIxICsgNjksIDk5OTk5KSAtLSAnZm1fbWlzc2lvbl9jb250cm9sbGVyJyBpbnN0YW50IGZpbmlzaCB2YXJpYWJsZT8KICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0xPQ0FMKCJmbV9taXNzaW9uX2NvbnRyb2xsZXIiLCAzMTYyMSArIDk3LCA4MCkgLS0gQWN0IDEgS2lsbHM/IFNlZW0gbm90IHRvIHdvcmsKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoZG9vbXNkYXlfc2VuaW9yLCAi5Y2V5Lq65by65Yi25ZCv5YqoIiwge30sICLlhYHorrjkvaDlnKjmsqHmnInlhbbku5bnjqnlrrbnmoTmg4XlhrXkuIvni6zoh6rov5vooYzmiqLliqsiLCBmdW5jdGlvbigpLS1VcGRhdGUgdGFnKDEuNjkpCiAgICAgICAgICAgICAgICAgICAgYWxsb3dfcGxheV9hbG9uZSgpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51Lmxpc3RfYWN0aW9uKGRvb21zZGF5X3NlbmlvciwgIua4heepuuWllueroOaMkeaImOiusOW9lSIsIHt9LCAiIiwgRG9vbXNkYXlNZWRhbFJlY29yZC5uYW1lLCBmdW5jdGlvbihpbmRleCkKICAgICAgICAgICAgICAgICAgICBsb2NhbCBzdGF0cyA9IERvb21zZGF5TWVkYWxSZWNvcmQua2V5W2luZGV4XQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVChzdGF0c1sxXSwgMCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9CT09MKHN0YXRzWzJdLCBmYWxzZSkKICAgICAgICAgICAgICAgIGVuZCkKCgogICAgLS3lhazlr5PmiqLliqsKICAgICAgICBsb2NhbCBDbGFzc2ljX2xpc3QgPSBtZW51Lmxpc3QoSGVpc3RDb250cm9sTGlzdCwgIuWFrOWvk+aKouWKqyIsIHt9LCAiIikKICAgICAgICAgICAgbG9jYWwgQ2xhc3NpY19zZXR0aW5nID0gbWVudS5saXN0KENsYXNzaWNfbGlzdCwgIuS7u+WKoeiuvuWumiIsIHt9LCAiIikKICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKENsYXNzaWNfc2V0dGluZywgIuWujOaIkOWJjee9ruS7u+WKoSIsIHt9LCAi5pyJ5Lu75Yqh6Z2i5p2/5pe25omN5Y+v5L2/55SoIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiSEVJU1RfUExBTk5JTkdfU1RBR0UiLCAtMSkKICAgICAgICAgICAgICAgICAgICB1dGlsLnRvYXN0KCLorr7nva7lrozmiJAsIOS9oOWPr+iDvemcgOimgemHjeaWsOi/m+WFpeWFrOWvk+adpeWIt+aWsOmdouadvyIpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LmFjdGlvbihDbGFzc2ljX3NldHRpbmcsICLph43nva7liY3nva7ku7vliqEiLCB7fSwgIuacieS7u+WKoemdouadv+aXtuaJjeWPr+S9v+eUqCIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkhFSVNUX1BMQU5OSU5HX1NUQUdFIiwgMCkKICAgICAgICAgICAgICAgICAgICB1dGlsLnRvYXN0KCLorr7nva7lrozmiJAsIOS9oOWPr+iDvemcgOimgemHjeaWsOi/m+WFpeWFrOWvk+adpeWIt+aWsOmdouadvyIpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIGxvY2FsIENsYXNzaWNfc2VuaW9yID0gbWVudS5saXN0KENsYXNzaWNfbGlzdCwgIumrmOe6p+mAiemhuSIsIHt9LCAiIikKICAgICAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoQ2xhc3NpY19zZW5pb3IsICLnp7vpmaTlhrfljbQiLCB7fSwgIui/meS4jeS8mue7lei/h+acjeWKoeWZqOerr+eahOWGt+WNtOaXtumXtCzljbMgMjDliIbpkp8uIOi/meWPquaYr+e7lei/h+aXoOazleWcqOaKouWKq+mdouadv+S4iuWPkei1t+aKouWKqyIsIGZ1bmN0aW9uKCktLVVwZGF0ZSB0YWcoMS42OSkKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0dMT0JBTCgxODc3Mjg1ICsgMSArIChQTEFZRVIuUExBWUVSX0lEKCkgKiA3NykgKyA3NiwgLTEpIC0tIFRoYW5rcyB0byBAdml0aGlhbSBvbiBEaXNjb3JkCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LnRvZ2dsZV9sb29wKENsYXNzaWNfc2VuaW9yLCAi5Y2V5Lq65by65Yi25ZCv5YqoIiwge30sICLlhYHorrjkvaDlnKjmsqHmnInlhbbku5bnjqnlrrbnmoTmg4XlhrXkuIvni6zoh6rov5vooYzmiqLliqsiLCBmdW5jdGlvbigpLS1VcGRhdGUgdGFnKDEuNjkpCiAgICAgICAgICAgICAgICAgICAgYWxsb3dfcGxheV9hbG9uZSgpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LmFjdGlvbihDbGFzc2ljX3NlbmlvciwgIuW8uuWItuWHhuWkhyIsIHt9LCAi6K6p5omA5pyJ546p5a625YGa5aW95YeG5aSHIiwgZnVuY3Rpb24oKS0tVXBkYXRlIHRhZygxLjY5KQogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKDI2NTc5NzEgKyAxICsgKDEgKiA0NjUpICsgMjY3LCA2KSAtLSBUaGFua3MgdG8gQHZpdGhpYW0gb24gRGlzY29yZAogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKDI2NTc5NzEgKyAxICsgKDIgKiA0NjUpICsgMjY3LCA2KQogICAgICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKDI2NTc5NzEgKyAxICsgKDMgKiA0NjUpICsgMjY3LCA2KQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS5jbGlja19zbGlkZXIoQ2xhc3NpY19zZW5pb3IsICLorr7nva7ku7vliqHnlJ/lkb3mlbAiLCB7fSwgIuehruS/neS9oOaYr+S7u+WKoeiEmuacrOS4u+acuiIsIDAsIDEwMCwgMywgMSwgZnVuY3Rpb24odmFsdWUpLS1VcGRhdGUgdGFnKDEuNjkpCiAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9MT0NBTCgiZm1fbWlzc2lvbl9jb250cm9sbGVyIiwgMTk3NDYgKyAxNzY1ICsgMSwgdmFsdWUgLSAxKQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS5saXN0X2FjdGlvbihDbGFzc2ljX3NlbmlvciwgIua4heepuuWllueroOaMkeaImOiusOW9lSIsIHt9LCAiIiwgQ2xhc3NpY01lZGFsUmVjb3JkLm5hbWUsIGZ1bmN0aW9uKGluZGV4KQogICAgICAgICAgICAgICAgICAgIGxvY2FsIHN0YXRzID0gQ2xhc3NpY01lZGFsUmVjb3JkLmtleVtpbmRleF0KICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoc3RhdHNbMV0sIDApCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfQk9PTChzdGF0c1syXSwgZmFsc2UpCiAgICAgICAgICAgICAgICAgICAgaWYgaW5kZXggPT0gMiB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiTVBQTFlfSEVJU1RURUFNUFJPR1JFU1NDT1VOVEVSIiwgMCkKICAgICAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgIGVuZCkKCiAgICAtLeaWsOaKouWKqwogICAgICAgIGxvY2FsIG90aGVyaGVpc3RfbGlzdCA9IG1lbnUubGlzdChIZWlzdENvbnRyb2xMaXN0LCAi5YW25LuW5oqi5YqrIiwge30sICIiKQogICAgICAgICAgICBsb2NhbCBMU19ST0JCRVJZID0gbWVudS5saXN0KG90aGVyaGVpc3RfbGlzdCwgIuaUueijhemTuuaKouWKqyIsIHt9LCAiIiwgZnVuY3Rpb24oKTsgZW5kKQogICAgICAgICAgICAgICAgbWVudS50ZXh0c2xpZGVyKExTX1JPQkJFUlksICLmlLnoo4Xpk7rmiqLliqsiLCB7fSwgIiIsIHsi6IGU5ZCI5YKo6JOEIiwi5aSn6ZKe5Lqk5piTIiwi6ZO26KGM5ZCI57qmIiwi55S15o6n5Y2V5YWDIiwi55uR54ux5ZCI57qmIiwiSUFBIOS6pOaYkyIsIuaRqeaJmOW4ruS6pOaYkyIsIuaVsOaNruWQiOe6piJ9LCBmdW5jdGlvbiAoaW5kZXgpCiAgICAgICAgICAgICAgICAgICAgaWYgaW5kZXggfj0gMiB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiVFVORVJfR0VOX0JTIiwgMTI1NDMpCiAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIlRVTkVSX0dFTl9CUyIsIDQzNTEpCiAgICAgICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiVFVORVJfQ1VSUkVOVCIsIGluZGV4IC0gMSkKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKExTX1JPQkJFUlksICLlrozmiJDlh4blpIfku7vliqEiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIlRVTkVSX0dFTl9CUyIsIC0xKQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oTFNfUk9CQkVSWSwgIumHjee9ruWHhuWkh+S7u+WKoSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiVFVORVJfR0VOX0JTIiwgMTI0NjcpCiAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LmFjdGlvbihMU19ST0JCRVJZLCAi6YeN572u5ZCI5ZCMIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJUVU5FUl9HRU5fQlMiLCA4MzcxKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiVFVORVJfQ1VSUkVOVCIsIC0xKQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oTFNfUk9CQkVSWSwgIumHjee9ruaAu+aUtuebiuWSjOWujOaIkOS7u+WKoSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiVFVORVJfQ09VTlQiLCAwKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiVFVORVJfRUFSTklOR1MiLCAwKQogICAgICAgICAgICAgICAgZW5kKQoKICAgICAgICAgICAgbG9jYWwgVEhfQ09OVFJBQ1QgPSBtZW51Lmxpc3Qob3RoZXJoZWlzdF9saXN0LCAi5ZCI57qmOiDlvrfnkZ7ljZrlo6siLCB7fSwgIiIpCiAgICAgICAgICAgICAgICBsb2NhbCBDT05UUkFDVF9WSVAgPSBtZW51Lmxpc3QoVEhfQ09OVFJBQ1QsICLlkIjnuqbmiqLliqsiLCB7fSwgIiIpCiAgICAgICAgICAgICAgICAgICAgbWVudS50ZXh0c2xpZGVyKENPTlRSQUNUX1ZJUCwgIuWknOeUn+a0u+azhOWvhiIsIHt9LCAiIiwgeyLlpJzmgLvkvJoiLCLnoIHlpLQiLCLlpJznlJ/mtLvms4Tlr4YifSwgZnVuY3Rpb24gKGluZGV4KQogICAgICAgICAgICAgICAgICAgICAgICBpZiBpbmRleCB+PSAzIHRoZW4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiRklYRVJfU1RPUllfQlMiLCBpbmRleCArIDIpCiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiRklYRVJfU1RPUllfQlMiLCAxMikKICAgICAgICAgICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiRklYRVJfR0VORVJBTF9CUyIsIC0xKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX0NPTVBMRVRFRF9CUyIsIC0xKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX1NUT1JZX0NPT0xET1dOIiwgLTEpCiAgICAgICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgICAgIG1lbnUudGV4dHNsaWRlcihDT05UUkFDVF9WSVAsICLkuIrmtYHnpL7kvJrms4Tlr4YiLCB7fSwgIiIsIHsi5Lmh5p2R5L+x5LmQ6YOoIiwi5a6+5a6i5YiX6KGoIiwi5LiK5rWB56S+5LyaIn0sIGZ1bmN0aW9uIChpbmRleCkKICAgICAgICAgICAgICAgICAgICAgICAgaWYgaW5kZXggPT0gMSB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX1NUT1JZX0JTIiwgMjgpCiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZiBpbmRleCA9PSAyIHRoZW4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiRklYRVJfU1RPUllfQlMiLCA2MCkKICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmIGluZGV4ID09IDMgdGhlbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJGSVhFUl9TVE9SWV9CUyIsIDEyNCkKICAgICAgICAgICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiRklYRVJfR0VORVJBTF9CUyIsIC0xKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX0NPTVBMRVRFRF9CUyIsIC0xKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX1NUT1JZX1NUUkFORCIsIC0xKQogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX1NUT1JZX0NPT0xET1dOIiwgLTEpCiAgICAgICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgICAgIG1lbnUudGV4dHNsaWRlcihDT05UUkFDVF9WSVAsICLkuIrmtYHnpL7kvJrms4Tlr4YiLCB7fSwgIiIsIHsi5oi057u05pavIiwi5be05YuS5biuIiwi5Luj55CG5bel5L2c5a6kIiwi5Yir5oO55b6355GeIn0sIGZ1bmN0aW9uIChpbmRleCkKICAgICAgICAgICAgICAgICAgICAgICAgaWYgaW5kZXggPT0gMSB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX1NUT1JZX0JTIiwgMjUyKQogICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYgaW5kZXggPT0gMiB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX1NUT1JZX0JTIiwgNTA4KQogICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYgaW5kZXggPT0gMyB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX1NUT1JZX0JTIiwgMjA0NCkKICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmIGluZGV4ID09IDQgdGhlbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJGSVhFUl9TVE9SWV9CUyIsIDQwOTIpCiAgICAgICAgICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZJWEVSX0dFTkVSQUxfQlMiLCAtMSkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJGSVhFUl9DT01QTEVURURfQlMiLCAtMSkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJGSVhFUl9TVE9SWV9TVFJBTkQiLCAtMSkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJGSVhFUl9TVE9SWV9DT09MRE9XTiIsIC0xKQogICAgICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgICAgICBtZW51LnRleHRzbGlkZXIoQ09OVFJBQ1RfVklQLCAi5b2V6Z+zIEEg5bel5L2c5a6kIiwge30sICIiLCB7IuenjeWtkOi1hOmHkSIsIueCueedgOWugyIsIuWFg+iAgeWkp+m6uyJ9LCBmdW5jdGlvbiAoaW5kZXgpCiAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiRklYRVJfU0hPUlRfVFJJUFMiLCBpbmRleCkKICAgICAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJGSVhFUl9HRU5FUkFMX0JTIiwgLTI1OTE2MDQ1NykKICAgICAgICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgICAgICBtZW51LmFjdGlvbihUSF9DT05UUkFDVCwgIuWujOaIkOaJgOacieS7u+WKoSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiRklYRVJfR0VORVJBTF9CUyIsIC0xKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiRklYRVJfQ09NUExFVEVEX0JTIiwgLTEpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJGSVhFUl9TVE9SWV9CUyIsIC0xKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiRklYRVJfU1RPUllfQ09PTERPV04iLCAtMSkKICAgICAgICAgICAgICAgIGVuZCkKCiAgICAgICAgICAgIGxvY2FsIENIT1BfU0hPUF9ST0IgPSBtZW51Lmxpc3Qob3RoZXJoZWlzdF9saXN0LCAi6LWD6L2m5bqX5oqi5YqrIiwge30sICIiKQogICAgICAgICAgICAgICAgbWVudS50ZXh0c2xpZGVyKENIT1BfU0hPUF9ST0IsICLotYPovablupfmiqLliqsiLCB7fSwgIiIsIHsi6LSn6Ii55oqi5YqrIiwi5bCP5re35re35oqi5YqrIiwi5p2c5qC55oqi5YqrIiwi5bGV5Y+w5oqi5YqrIiwi6bqm5omY5bC85oqi5YqrIn0sIGZ1bmN0aW9uIChpbmRleCkKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIlNBTFYyM19WRUhfUk9CIiwgaW5kZXggLSAxKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiTU9TVF9USU1FX09OXzNfUExVU19TVEFSUyAiLCAzMDAwMDApCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJTQUxWMjNfUExBTl9ESUFMT0dVRSIsIDQxMzExMDkpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJTQUxWMjNfRk1fUFJPRyIsIDEyNikKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIlNBTFYyM19HRU5fQlMiLCAtMTAyNDEpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJTQUxWMjNfRElTUlVQVCIsIDMpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfSU5UKCJTQUxWMjNfVkVIX01PRFMiLCAwKQogICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVCgiU0FMVjIzX1NDT1BFX0JTIiwgLTEpCiAgICAgICAgICAgICAgICAgICAgU1RBVF9TRVRfQk9PTCgiU0FMVjIzX0NBTl9LRUVQIiwgdHJ1ZSkKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoQ0hPUF9TSE9QX1JPQiwgIui3s+i/hyDmjIfnurnplIEiLCB7fSwgIumAgueUqOS6juWFieadn+aLvOWbvuWSjOaatOWKm+egtOinoyIsIGZ1bmN0aW9uKCktLVVwZGF0ZSB0YWcoMS42OSkKICAgICAgICAgICAgICAgICAgICBTRVRfSU5UX0xPQ0FMKCJmbV9jb250ZW50X3ZlaHJvYl9jYXNpbm9fcHJpemUiLCAxMDQ1ICsgMTM1LCAzKSAtLSBCZWFtIFB1enpsZSBIYWNrCiAgICAgICAgICAgICAgICAgICAgU0VUX0lOVF9MT0NBTCgiZm1fY29udGVudF92ZWhyb2JfcG9saWNlIiwgNzUxMSwgNTM2ODcxNDI1KSAtLSBCcnV0ZSBGb3JjZQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAKICAgICAgICBsb2NhbCBIZWlzdF90b29sc19saXN0ID0gbWVudS5saXN0KEhlaXN0Q29udHJvbExpc3QsICLlt6XlhbciLCB7fSwgIiIpCiAgICAgICAgICAgIGxvY2FsIFN0YXRfQ29vbGRvd24gPSBtZW51Lmxpc3QoSGVpc3RfdG9vbHNfbGlzdCwgIueri+WNs+enu+mZpOWGt+WNtOaXtumXtCIsIHt9LCAiIikKICAgICAgICAgICAgICAgIGZvciBfLCBpdGVtIGluIHBhaXJzKENvb2xkb3duU3RhdExpc3QpIGRvCiAgICAgICAgICAgICAgICAgICAgbWVudS5hY3Rpb24oU3RhdF9Db29sZG93biwgaXRlbS5uYW1lLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWwgc3RhdHMgPSB7IGl0ZW0uc3RhdCB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIHR5cGUoaXRlbS5zdGF0KSA9PSAidGFibGUiIHRoZW4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRzID0gaXRlbS5zdGF0CiAgICAgICAgICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICAgICAgICAgICBmb3IgXywgc3RhdCBpbiBwYWlycyhzdGF0cykgZG8KICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUQVRfU0VUX0lOVChzdGF0LCAwKQogICAgICAgICAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgICAgICAgICAgdXRpbC50b2FzdCgi5a6M5oiQISIpCiAgICAgICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICAgICAgZW5kCiAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQoKICAgIE11c2luZXNzX0JhbmFnZXIgPSBtZW51Lmxpc3QoUmVjb3ZlcnlfbGlzdCwgIuiHquWKqOi1hOS6pyIsIHt9LCAiIik7YXBwbWVudS5VbHRpb24uTXVzaW5lc3NCYW5hZ2VyID0gTXVzaW5lc3NfQmFuYWdlcgogICAgICAgIHJlcXVpcmUgImxpYi5TYWt1cmFTY3JpcHQuTXVzaW5lc3NCYW5hZ2VyIgoKICAgIC0t6LWM5Zy65Yi36ZKxCiAgICBsb2NhbCBicnVzaF9tb25leSA9IG1lbnUubGlzdChSZWNvdmVyeV9saXN0LCAi5Yi36ZKx6YCJ6aG5Iiwge30sICIiKTthcHBtZW51LlVsdGlvbi5CcnVzaE1vbmV5ID0gYnJ1c2hfbW9uZXkKICAgICAgICBjYXNpbm9fU2xvdF9NYWNoaW5lID0gbWVudS5saXN0KGJydXNoX21vbmV5LCAi5YWo6Ieq5Yqo6LWM5Zy66ICB6JmO5py6Iiwge30sICIiKQogICAgICAgICAgICByZXF1aXJlICJsaWIuU2FrdXJhU2NyaXB0LlNsb3RCb3QiCgogICAgICAgIFRyYW5zYWN0aW9uU2V0dGVyX29wdCA9IG1lbnUubGlzdChicnVzaF9tb25leSwgIuS6i+WKoeS6pOaYk+WIt+mSsSIsIHt9LCAiIikKICAgICAgICAgICAgZm9yIGksIHYgaW4gaXBhaXJzKHRyYW5zYWN0aW9ucykgZG8KICAgICAgICAgICAgICAgIG1lbnUuYWN0aW9uKFRyYW5zYWN0aW9uU2V0dGVyX29wdCwgdi5uYW1lLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgICAgICBUcmFuc2FjdGlvblNldHRlcih2Lmhhc2gsIHYuYW1vdW50KQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBlbmQKICAgICAgICB0YXNrX3RyYW5zYWN0aW9uX29wdCA9IG1lbnUubGlzdChicnVzaF9tb25leSwgIuS7u+WKoeS6pOaYk+WIt+mSsSIsIHt9LCAi6ZyA6KaB5Ya35Y205pe26Ze0IikKICAgICAgICAgICAgdGFza190cmFuc2FjdGlvbl9tb25leSgpCiAgICAgICAgYXBwbWVudS5VbHRpb24uTmV3RHJvcE1vbmV5ID0gbWVudS50b2dnbGVfbG9vcChicnVzaF9tb25leSwgIuaWsOaOiemSseiiiyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBuZXdfZHJvcF9tb25leSgpCiAgICAgICAgZW5kKQogICAgICAgIGxvY2FsIHBlZF9jYXNoID0gbWVudS5saXN0KGJydXNoX21vbmV5LCAiTlBD6YeR6ZKx5o6J6JC9Iiwge30pCiAgICAgICAgICAgIGxvY2FsIHBlZG1vbmV5ID0gNTIwCiAgICAgICAgICAgIG1lbnUuc2xpZGVyKHBlZF9jYXNoLCAn5L+u5pS56YeR6aKdJywgeydwY2ZpeGVkJ30sICdOUEPnjrDph5HmjonokL3mlbDph48nLCAxLCAyMDAwLCA1MjAsIDEsIGZ1bmN0aW9uKHZhbCkKICAgICAgICAgICAgICAgIHBlZG1vbmV5ID0gdmFsCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS50b2dnbGVfbG9vcChwZWRfY2FzaCwgJ+WQr+eUqCcsIHt9LCAn5L+u5pS55Ye75p2ATlBD5ZCO5Y+v5ou+5Y+W55qE6YeR6ZKx5pWw6YePJywgZnVuY3Rpb24oKSAKICAgICAgICAgICAgICAgIGxvY2FsIHBlZHMgPSBlbnRpdGllcy5nZXRfYWxsX3BlZHNfYXNfaGFuZGxlcygpCiAgICAgICAgICAgICAgICBQRUQuU0VUX0FNQklFTlRfUEVEU19EUk9QX01PTkVZKHRydWUpCiAgICAgICAgICAgICAgICBmb3IgX2luZGV4LCBwZWQgaW4gcGFpcnMocGVkcykgZG8KICAgICAgICAgICAgICAgICAgICBQRUQuU0VUX1BFRF9NT05FWShwZWQsIHBlZG1vbmV5KQogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIGVuZCkKICAgICAgICBsb2NhbCBjdXN0b21fbW9uZXlfcmVtb3ZlID0gbWVudS5saXN0KGJydXNoX21vbmV5LCAi6Ieq5a6a5LmJ6YeR6ZKx5Yig6ZmkIiwge30sICIiKS0tVXBkYXRlIHRhZygxLjY5KQogICAgICAgICAgICBtZW51LmFjdGlvbihjdXN0b21fbW9uZXlfcmVtb3ZlLCAi5Yig6Zmk6YeR6ZKxIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICByZW1vdmVfbW9uZXkoKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUuc2xpZGVyKGN1c3RvbV9tb25leV9yZW1vdmUsICLph5HpkrHmlbDpop0iLCB7Im1vbmV5cmVtb3ZlYW1vdW50In0sICIiLCAwLCAyMDAwMDAwMDAwLCAxMDAwMCwgMTAwMDAsIGZ1bmN0aW9uKHZhbHVlKQogICAgICAgICAgICAgICAgc2V0X3JlbW92ZV9tb25leV9hY2ModmFsdWUpCiAgICAgICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKGJydXNoX21vbmV5LCAi5L2c5byK56CB5Yi36ZKxIiwge30sICLovpPlhaXkvaDmg7PlvpfliLDnmoTph5HpkrEiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIGlmIFBBRC5JU19ESVNBQkxFRF9DT05UUk9MX0pVU1RfUFJFU1NFRCgwLCAyNDMpIHRoZW4KICAgICAgICAgICAgICAgIGxvY2FsIGxhYmVsID0gdXRpbC5yZWdpc3Rlcl9sYWJlbCgi5L2c5byK56CBIikKICAgICAgICAgICAgICAgIGxvY2FsIGlucHV0ID0gZ2V0X2lucHV0X2Zyb21fc2NyZWVuX2tleWJvYXJkKGxhYmVsLCAyMCwgIiIpCiAgICAgICAgICAgICAgICBpZiB0eXBlKHRvbnVtYmVyKGlucHV0KSkgfj0gIm51bWJlciIgb3Igbm90IGlzTnVtYmVySW5SYW5nZSh0b251bWJlcihpbnB1dCksIDAsIDE1MDAwMDAwKSB0aGVuCiAgICAgICAgICAgICAgICAgICAgdXRpbC50b2FzdCgi5peg5pWI5pWw5a2XLOacgOWkp+WMuumXtDAtMTUwMDAwMDAiKQogICAgICAgICAgICAgICAgICAgIHJldHVybgogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICBUcmFuc2FjdGlvblNldHRlcigweDE3NkQ5RDU0LCBpbnB1dCkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudGV4dHNsaWRlcihicnVzaF9tb25leSwgIuW/q+mAn+WIt+mSsSIsIHt9LCAi5peg5Ya35Y205Yiw6LSm5LiA56yU6LWE6YeRIiwgeyJUb0JhbmsiLCJUb1dhbGxldCJ9LCBmdW5jdGlvbiAoaW5kZXgpCiAgICAgICAgICAgIHF1aWNrX2JydXNoX21vbmV5KGluZGV4KQogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRleHRzbGlkZXIoYnJ1c2hfbW9uZXksICLlv6vpgJ/liKDpkrEiLCB7fSwgIuWJjeaPkOS9oOmcgOimgeaLpeacieWkp+minei1hOmHkSIsIHsiRnJvbUJhbmsiLCJGcm9tV2FsbGV0In0sIGZ1bmN0aW9uIChpbmRleCkKICAgICAgICAgICAgcXVpY2tfcmVtb3ZlX21vbmV5KG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3QsICLov5zmjqflnLDloKEiLCB7IiJ9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgU1RBUlRfU0NSSVBUKCJhcHBidW5rZXJidXNpbmVzcyIpCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS5hY3Rpb24oY29udHJvbF9zY3JlZW5fbGlzdCwgIui/nOaOp+acuuW6kyIsIHsiIn0sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBTVEFSVF9TQ1JJUFQoImFwcHNtdWdnbGVyIikKICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBtZW51LmFjdGlvbihjb250cm9sX3NjcmVlbl9saXN0LCAi6L+c5o6n5aSc5oC75LyaIiwgeyIifSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgIFNUQVJUX1NDUklQVCgiYXBwYnVzaW5lc3NodWIiKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNvbnRyb2xfc2NyZWVuX2xpc3QsICLov5zmjqfmkanmiZjluK4iLCB7IiJ9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgU1RBUlRfU0NSSVBUKCJhcHBiaWtlcmJ1c2luZXNzIikKICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBtZW51LmFjdGlvbihjb250cm9sX3NjcmVlbl9saXN0LCAi6L+c5o6n6I6x5pav54m56Z2i5p2/IiwgeyIifSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgIFNUQVJUX1NDUklQVCgiYXBwYXJjYWRlYnVzaW5lc3NodWIiKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNvbnRyb2xfc2NyZWVuX2xpc3QsICLov5zmjqfmgZDpnLgiLCB7IiJ9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgU1RBUlRfU0NSSVBUKCJhcHBoYWNrZXJ0cnVjayIpCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS5hY3Rpb24oY29udHJvbF9zY3JlZW5fbGlzdCwgIui/nOaOp+S6i+WKoeaJgCIsIHsiIn0sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBTVEFSVF9TQ1JJUFQoImFwcGZpeGVyc2VjdXJpdHkiKQogICAgICAgICAgICBlbmQpCiAgICAgICAgbG9jYWwgU3RhdF9DdXRzY2VuZSA9IG1lbnUubGlzdChnYW1lX3Rvb2xzX2xpc3QsICLnp7vpmaTpppbmrKHov5vlhaXotYTkuqfnmoTliqjnlLvmlZnnqIsiLCB7fSwgIiIpCiAgICAgICAgICAgIGZvciBfLCBpdGVtIGluIHBhaXJzKEJ1c2luZXNzQ3V0c2NlbmVCaXRMaXN0KSBkbwogICAgICAgICAgICAgICAgbWVudS50ZXh0c2xpZGVyKFN0YXRfQ3V0c2NlbmUsIGl0ZW0ubmFtZSwge30sICIiLCB7Iuiuvue9riIsICLph43orr4ifSwgZnVuY3Rpb24odmFsdWUpCiAgICAgICAgICAgICAgICAgICAgbG9jYWwgaVN0YXRJbnQgPSBTVEFUX0dFVF9JTlQoIkZNX0NVVF9ET05FIikKICAgICAgICAgICAgICAgICAgICBpZiB2YWx1ZSA9PSAxIHRoZW4KICAgICAgICAgICAgICAgICAgICAgICAgaVN0YXRJbnQgPSBTRVRfQklUKGlTdGF0SW50LCB0YWJsZS51bnBhY2soaXRlbS5iaXRzKSkKICAgICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgICAgIGlTdGF0SW50ID0gQ0xFQVJfQklUKGlTdGF0SW50LCB0YWJsZS51bnBhY2soaXRlbS5iaXRzKSkKICAgICAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgICAgICBTVEFUX1NFVF9JTlQoIkZNX0NVVF9ET05FIiwgaVN0YXRJbnQpCiAgICAgICAgICAgICAgICAgICAgdXRpbC50b2FzdCgi5a6M5oiQISIpCiAgICAgICAgICAgICAgICB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9zMS56LCAwLCAwLCAwLCB0cnVlLCB0cnVlLCB0cnVlLCB0cnVlLCAwLCB0cnVlLCAwKQoKICAgICAgICAgICAgd2hpbGUgRU5USVRZLklTX0VOVElUWV9BVFRBQ0hFRChkb2xsKSBkbwoKICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKDI5MTAxNSwgMCkKICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKDI5MTAxNiwgMCkKICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKDI5MTAxNywgMCkKICAgICAgICAgICAgICAgIFNFVF9JTlRfR0xPQkFMKDI5MTAxOCwgMCkKCiAgICAgICAgICAgICAgICBpZiBQQUQuSVNfRElTQUJMRURfQ09OVFJPTF9KVVNUX1BSRVNTRUQoMCwgMTkxKSB0aGVuCiAgICAgICAgICAgICAgICAgICAgRU5USVRZLkRFVEFDSF9FTlRJVFkoZG9sbCwgdHJ1ZSwgdHJ1ZSkKICAgICAgICAgICAgICAgICAgICAtLUVOVElUWS5TRVRfRU5USVRZX0NPTExJU0lPTihkb2xsLCB0cnVlLCB0cnVlKQogICAgICAgICAgICAgICAgICAgIEVOVElUWS5BUFBMWV9GT1JDRV9UT19FTlRJVFkoZG9sbCwgMCwgMC4wLCAwLjAsIDAuMCwgMC4wLCAwLjAsIDAuMCwgMCwgZmFsc2UsIHRydWUsIHRydWUsIHRydWUsIHRydWUpCiAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgIHV0aWwueWllbGQoKQogICAgICAgICAgICBlbmQKICAgICAgICAgICAgdXRpbC50b2FzdCgi5YiG56a7IikKICAgICAgICBlbHNlCiAgICAgICAgICAgIHV0aWwueWllbGQoIuacquaJvuWIsOaMh+WumuWog+WogyIpCiAgICAgICAgZW5kCgogICAgZW5kKSBdXQoKICAgIGxvY2FsIGF1dG9fdGF4aV9saXN0ID0gbWVudS5saXN0KFJlY292ZXJ5X2xpc3QsICfoh6rliqjlh7rnp5/ovaYnLCB7fSwgJycpCiAgICAgICAgbWVudS50b2dnbGUoYXV0b190YXhpX2xpc3QsICfoh6rliqjlh7rnp5/ovaYnLCB7fSwgJ+mAmui/h+WHuuenn+i9puiHquWKqOaOpemAgeS6uuWRmCcsIGZ1bmN0aW9uICh0b2dnbGVkKQogICAgICAgICAgICBhdXRvX3RheGkodG9nZ2xlZCkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50ZXh0c2xpZGVyKGF1dG9fdGF4aV9saXN0LCAi5Ye656ef5Ye66KGM5Li6Iiwge30sICLpgInmi6nkuIDnp43mlrnlvI9cbueCueWHu+WIh+aNoiIsIHsi6am+6am2Iiwi5Lyg6YCBIn0sIGZ1bmN0aW9uIChpbmRleCkKICAgICAgICAgICAgY2hlY2tfdGF4aV93YXkoaW5kZXgpCiAgICAgICAgZW5kKQogICAgICAgIAogICAgbG9jYWwgVGFza19zZW5pb3JfbGlzdCA9IG1lbnUubGlzdChSZWNvdmVyeV9saXN0LCAn6auY57qn5Yqf6IO9Jywge30sICcnKQogICAgICAgIG1lbnUuYWN0aW9uKFRhc2tfc2VuaW9yX2xpc3QsICLot7Pov4fkuIDlj6VOUEPlr7nor50iLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgQVVESU8uU0tJUF9UT19ORVhUX1NDUklQVEVEX0NPTlZFUlNBVElPTl9MSU5FKCkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcChUYXNrX3Nlbmlvcl9saXN0LCAi6Ieq5Yqo6Lez6L+HTlBD5a+56K+dIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIGlmIEFVRElPLklTX1NDUklQVEVEX0NPTlZFUlNBVElPTl9PTkdPSU5HKCkgdGhlbgogICAgICAgICAgICAgICAgQVVESU8uU1RPUF9TQ1JJUFRFRF9DT05WRVJTQVRJT04oZmFsc2UpCiAgICAgICAgICAgICAgICBBVURJTy5TS0lQX1RPX05FWFRfU0NSSVBURURfQ09OVkVS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X25hbWUsIHByZXZfdmFsdWUsIGNsaWNrX3R5cGUpCiAgICAgICAgICAgIHNob290ZW50ID0gZ3Jhdml0eV9lbnRpdHlfZ3VuLnZhbHVlW3ZhbHVlXQogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKGVudGl0eV9ndW4sICfmspnlnZfmnqonLCB7fSwgJycsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgbG9jYWwgcG9zID0gdjMubmV3KCkKICAgICAgICAgICAgaWYgV0VBUE9OLkdFVF9QRURfTEFTVF9XRUFQT05fSU1QQUNUX0NPT1JEKFBMQVlFUi5QTEFZRVJfUEVEX0lEKCksIHBvcykgdGhlbgogICAgICAgICAgICAgICAgY3JlYXRlX29iamVjdCh1dGlsLmpvYWF0KCdwcm9wX21iX3NhbmRibG9ja18wMScpLCBwb3MueCwgcG9zLnksIHBvcy56KQogICAgICAgICAgICBlbmQKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcChlbnRpdHlfZ3VuLCAi55uu5qCH6Z22Iiwge30sICIiLCBmdW5jdGlvbigpIAogICAgICAgICAgICBsb2NhbCBwb3MgPSB2My5uZXcoKQogICAgICAgICAgICBpZiBXRUFQT04uR0VUX1BFRF9MQVNUX1dFQVBPTl9JTVBBQ1RfQ09PUkQoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgcG9zKSBhbmQgbm90IFBFRC5JU19QRURfSU5fQU5ZX1ZFSElDTEUoUExBWUVSLlBMQVlFUl9QRURfSUQoKSkgdGhlbgogICAgICAgICAgICAgICAgY3JlYXRlX3Nob290aW5nX3RhcmdldChwb3MueCwgcG9zLnksIHBvcy56KQogICAgICAgICAgICBlbmQKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcChlbnRpdHlfZ3VuLCAi5omL5Yqe5p6qIiwge30sICIiLCBmdW5jdGlvbigpIAogICAgICAgICAgICBsb2NhbCBwb3MgPSB2My5uZXcoKQogICAgICAg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z1biwi5o6o6L+b6L295YW3Iiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgaWYgUEVELklTX1BFRF9TSE9PVElORyhQTEFZRVIuUExBWUVSX1BFRF9JRCgpKSB0aGVuCiAgICAgICAgICAgIGxvY2FsIGVudGl0eSA9IGdldF9lbnRpdHlfcGxheWVyX2lzX2FpbWluZ19hdChQTEFZRVIuUExBWUVSX0lEKCkpCiAgICAgICAgICAgIGlmIGVudGl0eSB+PSAwIHRoZW4KICAgICAgICAgICAgICAgIGlmIEVOVElUWS5JU19FTlRJVFlfQV9WRUhJQ0xFKGVudGl0eSkgdGhlbgogICAgICAgICAgICAgICAgICAgIFZFSElDTEUuU0VUX1ZFSElDTEVfRk9SV0FSRF9TUEVFRChlbnRpdHksIDEwMCkKICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICBlbmQKICAgICAgICBlbmQKICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlX2xvb3Aod2VhcG9uX2Z1biwi5Ya757uT5a6e5L2TIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgaWYgUEVELklTX1BFRF9TSE9PVElORyhQTEFZRVIuUExBWUVSX1BFRF9JRCgpKSB0aGVuCiAgICAgICAgICAgIGxvY2FsIGVudGl0eSA9IGdldF9lbnRpdHlfcGxheWVyX2lzX2FpbWluZ19hdChQTEFZRVIuUExBWUVSX0lEKCkpCiAgICAgICAgICAgIGlmIGVudGl0eSB+PSAwIHRoZW4KICAgICAgICAgICAgICAgIEVOVElUWS5GUkVFWkVfRU5USVRZX1BPU0lUSU9OKGVudGl0eSwgdHJ1ZSkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKHdlYXBvbl9mdW4sICLovazprYLmnqoiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICBTb3VsX0d1bigpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbih3ZWFwb25fZnVuLCAi5Y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ZnVuY3Rpb24oKQogICAgICAgIGxvY2huZXNzX21rMigpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbih2ZWhpY2xlX2Z1biwgIumpvumptumjnuWkqeaJq+W4miIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIGZseWluZ19icm9vbSgpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbih2ZWhpY2xlX2Z1biwgIumpvumptui2hee6p+mjnuacuiIsIHt9LCAi5b63572X57Si6aOe6KGM5qih5byPIiwgZnVuY3Rpb24oKQogICAgICAgIHN1cGVyX3BoYW5lKCkKICAgIGVuZCkKICAgIG1lbnUuYWN0aW9uKHZlaGljbGVfZnVuLCAi6am+6am26LaF57qn5ri46ImHIiwge30sICLlnKjmsLTpnaLkuIrnlJ/miJAiLCBmdW5jdGlvbiAoKQogICAgICAgIHN1cGVyX3lhY2h0KCkKICAgIGVuZCkKICAgIG1lbnUudGV4dHNsaWRlcih2ZWhpY2xlX2Z1biwgIuaegemZkOi3s+i3gyIsIHt9LCAi5YaN546w5Zyw5bmz57q/IiwgeyLkvY4iLCLkuK0iLCLpq5gifSwgZnVuY3Rpb24oaW5kZXgpCiAgICAgICAgZXh0cmVtZV9qdW1wKGluZGV4KQogICAgZW5kKQogICAgbG9jYWwgVUZPX3ZlaGljbGVzID0gbWVudS5saXN0KHZlaGljbGVfZnVuLCAiVUZP6L295YW3Iiwge30sICIiKTthcHBtZW51LlVsdGlvbi5VRk9WZWhpY2xlcyA9IFVGT192ZWhpY2xlcwogICAgICAgIG1lbnUudGV4dHNsaWRlcihVRk9fdmVoaWNsZXMsICJVRk8iLCB7fSwgIumpvumptlVGTyzkvb/nlKjnibXlvJXlhYnmnZ/lkozlpKfngq4iLCB1Zm9fbmFtZSwgZnVuY3Rpb24gKGluZGV4KQogICAgICAgICAgICBsb2NhbCBvYmogPSBvYmpNb2RlbHNbaW5kZXhdCiAgICAgICAgICAgIFVGTy5zZXRPYmpNb2RlbChvYmopCiAgICAgICAgICA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AgIGVuZCkKICAgICAgICAgICAgbWVudS5hY3Rpb24oc3Bhd25fdHJ1Y2tfY2FyLCAi54yb5Ye75Y2h6L2mIiwge30sICLnlJ/miJDkuIDovobnjJvlh7vljaHovabov5vooYznibXlvJUiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoInNsYW10cnVjayIpCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS50b2dnbGUoc3Bhd25fdHJ1Y2tfY2FyLCAi6ZmE5YqgIiwge30sICLku7vkvZXov5Hot53nprvovabovobpg73lsIbov57mjqXliLDmgqjlvZPliY3nmoTovabovobkuIoiLCBmdW5jdGlvbihvbikKICAgICAgICAgICAgICAgIGlmIG9uIHRoZW4KICAgICAgICAgICAgICAgICAgICBhdHRhY2hfbmVhcmVzdF92ZWhpY2xlKCkKICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICBkZXRhY2hfYXR0YWNoZWRfdmVoaWNsZSgpIAogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIGVuZCkKICAgICAgICBsb2NhbCBjYXJnb2JvYk1lbnUgPSBtZW51Lmxpc3Qoc3Bhd25fdHJ1Y2ssICLotKfov5Dnm7TljYfmnLoiLCB7fSkKICAgICAgICAgICAgbWVudS5hY3Rpb24oY2FyZ29ib2JNZW51LCAi56OB5ZC46L+Q5YW155u05Y2H5py6Iiwge30sICLmjIlF5L2/55So5ZCK5oyCIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgc3Bhd25fY2FyZ29ib2Jfd2l0aF9tYWduZXQoKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUuYWN0aW9uKGNhcmdvYm9iTWVudSwgIui/kOWFteebtOWNh+acuiIsIHt9LCAi5oyJSOmUrui/nuaOpei9veWFtyzmjIlF5Lii5byD6L295YW3IixmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBzcGF3bl9jYXJnb2Jv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eiyIpCiAgICAgICAgc2ltcGxlXzNkID0gbWVudS5saXN0KFNob290aW5nX3ByYWN0aWNlLCIzROWwhOWHuyIsIHt9LCAiIikKICAgICAgICAgICAgbWVudS5kaXZpZGVyKHNpbXBsZV8zZCwiM0TlsITlh7siKQogICAgICAgICAgICBzaW1wbGVfM2RfdG9nZ2xlID0gbWVudS50b2dnbGUoc2ltcGxlXzNkLCLlvIDlp4siLCB7fSwgIiIsIGZ1bmN0aW9uKHRvZ2dsZSkKICAgICAgICAgICAgICAgIFNob290aW5nX3NpbXVsYXRpb25fM0QodG9nZ2xlKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUuZGl2aWRlcihzaW1wbGVfM2QsIua4uOaIj+iuvue9riIpCiAgICAgICAgICAgIG1lbnUubGlzdF9hY3Rpb24oc2ltcGxlXzNkLCLorr7lrprnirblhrUiLCB7fSwgIiIsIHBlZF9oZWFsdGhfc2VsZWN0b3IuZGlzcGxheV9vcHRpb25zLCBmdW5jdGlvbihpbmRleCkKICAgICAgICAgICAgICAgIFNldF9jb25kaXRpb25fM0QoaW5kZXgpCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS5saXN0X2FjdGlvbihzaW1wbGVfM2QsIua4uOaIj+aXtumXtCIsIHt9LCAiIiwgdGltZV9zZWxlY3Rvci5kaXNwbGF5X29wdGlvbnMsIGZ1bmN0aW9uKGluZGV4KQogICAgICAgICAgICAgICAgU2V0X3Nob290X3RpbWVfM0QoaW5kZXgpCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS5saXN0X2FjdGlvbihzaW1wbGVfM2QsIuebruagh+acgOWkp+eUn+aIkOmrmOW6piIsIHt9LCAiIiwgc2ltcGxlM2RfdGFyZ2V0X21heF9oZWlnaHQuZGlzcGxheV9vcHRpb25zLCBmdW5jdGlvbihpbmRleCkKICAgICAgICAgICAgICAgIFRhcmdldF9idWlsZF9oZWlnaHRfM0QoaW5kZXgpCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS50b2dnbGUoc2ltcGxlXzNkLCAi5YWB6K64UEVE56e75YqoIiwge30sICIiLCBmdW5jdGlvbih0b2dnbGUpCiAgICAgICAgICAgICAgICB0YXJnZXRfbW92ZSh0b2dnbGUpCiAgICAgICAgICAgIGVuZCkKCiAgICAgICAgc2ltcGxlXzJkID0gU2hvb3RpbmdfcHJhY3RpY2U6bGlzdCgiMkTlsITlh7siLCB7fSwgIiIpCiAgICAgICAgICAgIG1lbnUuZGl2aWRlcihzaW1wbGVfMmQsIjJE5bCE5Ye7IikKICAgICAgICAgICAgc2ltcGxlXzJkX3RvZ2dsZSA9IG1lbnUudG9nZ2xlKHNpbXBsZV8yZCwi5byA5aeLIiwge30sICIiLCBmdW5jdGlvbih0b2dnbGUpCiAgICAgICAgICAgICAgICBTaG9vdGluZ19zaW11bGF0aW9uXzJEKHRvZ2dsZSkKICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBtZW51LmRpdmlkZXIoc2ltcGxlXzJkLCLmuLjmiI/orr7nva4iKQogICAgICAgICAgICBtZW51Lmxpc3RfYWN0aW9uKHNpbXBsZV8yZCwi6K6+5a6a54q25Ya1Iiwge30sICIiLCBwZWRfaGVhbHRoX3NlbGVjdG9yLmRpc3BsYXlfb3B0aW9ucywgZnVuY3Rpb24oaW5kZXgpCiAgICAgICAgICAgICAgICBTZXRfY29uZGl0aW9uXzJEKGluZGV4KQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUubGlzdF9hY3Rpb24oc2ltcGxlXzJkLCLmuLjmiI/ml7bpl7QiLCB7fSwgIiIsIHRpbWVfc2VsZWN0b3IuZGlzcGxheV9vcHRpb25zLCBmdW5jdGlvbihpbmRleCkKICAgICAgICAgICAgICAgIFNldF9zaG9vdF90aW1lXzJEKGluZGV4KQogICAgICAgICAgICBlbmQpCgogICAgZ3JlZW5fc29kYSA9IG1lbnUubGlzdChmdW5mZWF0dXJlcywgIue7v+axveawtCIpCiAgICAgICAgcmVxdWlyZSAibGliLlNha3VyYVNjcmlwdC5TcHJ1bmtTdG9wIgoKICAgIG1lbnUudG9nZ2xlKGZ1bmZlYXR1cmVzLCAi54G16a2C5Ye656qNIiwge30sICIiLCBmdW5jdGlvbih0b2dnbGUpCiAgICAgICAgT3V0X2JvZHkodG9nZ2xlKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcChmdW5mZWF0dXJlcywgImhvbWVy57KS5a2QIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgaG9tZXJfcGFydGljbGUoKQogICAgZW5kKQogICAgbWVudS50b2dnbGUoZnVuZmVhdHVyZXMsICLngavmi7MiLHt9LCAiIixmdW5jdGlvbihvbikKICAgICAgICBGaXJlX0Zpc3Qob24pCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZShmdW5mZWF0dXJlcywgIuihgOaLsyIse30sICIiLGZ1bmN0aW9uKG9uKQogICAgICAgIEJsb29kX0Zpc3Qob24pCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZShmdW5mZWF0dXJlcywgIumbt+eUteaLsyIse30sICIiLGZ1bmN0aW9uKG9uKQogICAgICAgIFJhaWRlbl9GaXN0KG9uKQogICAgZW5kKQoKICAgIEhlbGxfVW5kZWFkID0gbWVudS5saXN0KGZ1bmZlYXR1cmVzLCAi5Zyw54ux5Lqh54G1Iiwge30sICIiKQogICAgICAgIG1lbnUudG9nZ2xlKEhlbGxfVW5kZWFkLCAi5Zyw54ux5Lqh54G1Iiwge30sICIiLCBmdW5jdGlvbihvbikKICAgICAgICAgICAgaWYgb24gdGhlbgogICAgICAgICAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJncmFjZSBvbiIpCiAgICAgICAgICAgICAgICBtZW51LnNldF92YWx1ZShCdXJuaW5nX01hbiwgdHJ1ZSkKICAgICAgICAgICAgICAgIG1lbnUuc2V0X3ZhbHVlKHJ1bnNwZWVkLCB0cnVlKQogICAgICAgICAgICAgICAgbWVudS5zZXRfdmFsdWUoc3VwZXJqdW1wLCB0cnVlKQogICAgICAgICAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJ0cmFpbHMgb24iKQogICAgICAgICAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJ0cmFpbGNvbG91cnJhaW5ib3cgMSIpCiAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgIG1lbnUuc2V0X3ZhbHVlKEJ1cm5pbmdfTWFuLCBmYWxzZSkKICAgICAgICAgICAgICAgIG1lbnUuc2V0X3ZhbHVlKHJ1bnNwZWVkLCBmYWxzZSkKICAgICAgICAgICAgICAgIG1lbnUuc2V0X3ZhbHVlKHN1cGVyanVtcCwgZmFsc2UpCiAgICAgICAgICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoInRyYWlscyBvZmYiKQogICAgICAgICAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJ0cmFpbGNvbG91cnJhaW5ib3cgMCIpCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKCiAgICAgICAgbWVudS5kaXZpZGVyKEhlbGxfVW5kZWFkLCLorr7nva4iKQogICAgICAgICAgICBydW5zcGVlZCA9IG1lbnUudG9nZ2xlKEhlbGxfVW5kZWFkLCAi5aWU6LeR6YCf5bqmIiwge30sICIiLCBmdW5jdGlvbihvbikKICAgICAgICAgICAgICAgIGlmIG9uIHRoZW4KICAgICAgICAgICAgICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoIndhbGtzcGVlZCAxLjUiKQogICAgICAgICAgICAgICAgICAgIG1lbnUudHJpZ2dlcl9jb21tYW5kcygiZ3JhY2VmdWxsYW5kaW5nIG9uIikKICAgICAgICAgICAgICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoInN1cGVycnVuIDEuMiIpCiAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJ3YW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ICAgICAgICAgICBzaG93X2JhbGNraG9sZSgpCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUubGlzdF9zZWxlY3QoYmxhY2tfaG9sZV9sdCwgIum7kea0nuexu+WeiyIsIHt9LCAiIiwge3sxLCLlkLjlvJUifSwgezIsIuaOkuaWpSJ9fSwgMSwgZnVuY3Rpb24odmFsdWUsIG1lbnVfbmFtZSwgcHJldl92YWx1ZSwgY2xpY2tfdHlwZSkKICAgICAgICAgICAgYmxhY2tfaG9sZV90eXBlKHZhbHVlLCBtZW51X25hbWUsIHByZXZfdmFsdWUsIGNsaWNrX3R5cGUpCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUuc2xpZGVyKGJsYWNrX2hvbGVfbHQsICLorr7nva7pu5HmtJ7lvLrluqYiLCB7fSwgIiIsIDEsIDEwMCwgMSwgMSwgZnVuY3Rpb24oYSkKICAgICAgICAgICAgYmxhY2tfaG9sZV9TdGgoYSkKICAgICAgICBlbmQpCiAgICAgICAgYmxhY2tfaG9sZV9jb29yZCA9IG1lbnUubGlzdChibGFja19ob2xlX2x0LCAi6K6+5a6a5L2N572uIiwge30sICIiKQogICAgICAgICAgICBtZW51LmFjdGlvbihibGFja19ob2xlX2Nvb3JkLCAi5Zyo6Ieq6Lqr5aSE6K6+572u6buR5rSe5L2N572uIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBibGFja19ob2xlX3Bvc3VzZXIoKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIGJsYWNrSG9sZVBvc1ggPSBtZW51LnNsaWRlcihibGFja19ob2xlX2Nvb3JkLCAi6buR5rSe5L2N572uIFgiLCB7ImNvb3JkQmxhY2tIb2xlWCJ9LCAiIiwgLTEwMDAwMCwgMTAwMDAwLCAwLCAxLCBmdW5jdGlvbihhKQogICAgICAgICAgICAgICAgYmxhY2tfaG9sZV9wb3N4KGEpCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgYmxhY2tIb2xlUG9zWSA9I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pCiAgICAgICAgICAgICAgICBpZiBub3QgY2F0X3BlZHAgb3Igbm90IEVOVElUWS5ET0VTX0VOVElUWV9FWElTVChjYXRfcGVkcCkgdGhlbgogICAgICAgICAgICAgICAgICAgIGxvY2FsIGNhdGhhc2ggPSB1dGlsLmpvYWF0KCJhX2NfY2F0XzAxIikKICAgICAgICAgICAgICAgICAgICByZXF1ZXN0X21vZGVsKGNhdGhhc2gpCiAgICAgICAgICAgICAgICAgICAgbG9jYWwgcG9zID0gcGxheWVycy5nZXRfcG9zaXRpb24oUExBWUVSLlBMQVlFUl9JRCgpKQogICAgICAgICAgICAgICAgICAgIGNhdF9wZWRwID0gZW50aXRpZXMuY3JlYXRlX3BlZCgyOCwgY2F0aGFzaCwgcG9zLCAwKQogICAgICAgICAgICAgICAgICAgIFBFRC5TRVRfUEVEX0NPTVBPTkVOVF9WQVJJQVRJT04oY2F0X3BlZHAsIDAsIDAsIDEsIDApCiAgICAgICAgICAgICAgICAgICAgRU5USVRZLlNFVF9FTlRJVFlfSU5WSU5DSUJMRShjYXRfcGVkcCwgdHJ1ZSkKICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICAgTkVUV09SSy5ORVRXT1JLX1JFUVVFU1RfQ09OVFJPTF9PRl9FTlRJVFkoY2F0X3BlZHApCiAgICAgICAgICAgICAgICBUQVNLLlRBU0tfRk9MTE9XX1RPX09GRlNFVF9PRl9FTlRJVFkoY2F0X3BlZHAsIFBMQVlFUi5QTEFZRVJfUEVEX0lEKCksIDAsIC0wLjMsIDAsIDcuMCwgLTEsIDEuNSwgdHJ1ZSkKICAgICAgICAgICAgICAgIHV0aWwueWllbGQoMjUwMCkKICAgICAgICAgICAgZW5kLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBkZWxldGVfZW50aXR5KGNhdF9wZWRwKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbihwZWRfY2F0cywgIuaJvuWIsOeMq+eMqyIsIHt9LCAi5bCG54yr54yr5Lyg6YCB5Yiw5L2g6Lqr6L65IiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgbG9jYWwgcGxheWVyID0gUExBWUVSLlBMQVlFUl9QRURfSUQoKQogICAgICAgICAgICAgICAgbG9jYWwgcG9zID0gRU5USVRZLkdFVF9FTlRJVFlfQ09PUkRTKHBsYXllciwgZmFsc2UpCiAgICAgICAgICAgICAgICBFTlRJVFkuU0VUX0VOVElUWV9DT09SRFNfTk9fT0ZGU0VUKGNhdF9wZWRwLCBwb3MueCwgcG9zLnksIHBvcy56LCBmYWxzZSwgZmFsc2UsIGZhbHNlKQogICAgICAgICAgICBlbmQpCgogICAgICAgIGxvY2FsIGNhdF9hcm15ID0ge30KICAgICAgICBsb2NhbCBhcm15ID0gbWVudS5saXN0KHBlZF9jYXRzLCAi5a6g54mp54yr54yr5Yab6ZifIiwge30sICLlk4jlk4jlk4gs5LiA576k5bCP54yr54yrIikKICAgICAgICAgICAgbWVudS5jbGlja19zbGlkZXIoYXJteSwgIueUn+aIkOaVsOmHjyIsIHt9LCAi6YCJ5ZCnLOWkmueUn+aIkOeCuSzmnIDlpJoyNTblj6oiLCAxLCAyNTYsIDMwLCAxLCBmdW5jdGlvbih2YWwpCiAgICAgICAgICAgICAgICBsb2NhbCBwZWQgPSBQTEFZRVIuUExBWUVSX1BFRF9JRCgpCiAgICAgICAgICAgICAgICBsb2NhbCBwb3MgPSBFTlRJVFkuR0VUX0VOVElUWV9DT09SRFMocGVkLCBmYWxzZSkKICAgICAgICAgICAgICAgIHBvcy55ID0gcG9zLnkgLSA1CiAgICAgICAgICAgICAgICBwb3MueiA9IHBvcy56ICsgMQogICAgICAgICAgICAgICAgbG9jYWwgamlueCA9IHV0aWwuam9hYXQoImFfY19jYXRfMDEiKQogICAgICAgICAgICAgICAgcmVxdWVzdF9tb2RlbChqaW54KQogICAgICAgICAgICAgICAgZm9yIGkgPSAxLCB2YWwgZG8KICAgICAgICAgICAgICAgICAgICBjYXRfYXJteVtpXSA9IGVudGl0aWVzLmNyZWF0ZV9wZWQoMjgsIGppbngsIHBvcywgMCkKICAgICAgICAgICAgICAgICAgICBFTlRJVFkuU0VUX0VOVElUWV9JTlZJTkNJQkxFKGNhdF9hcm15W2ldLCB0cnVlKQogICAgICAgICAgICAgICAgICAgIFBFRC5TRVRfQkxPQ0tJTkdfT0ZfTk9OX1RFTVBPUkFSWV9FVkVOVFMoY2F0X2FybXlbaV0sIHRydWUpCiAgICAgICAgICAgICAgICAgICAgUEVELlNFVF9QRURfQ09NUE9ORU5UX1ZBUklBVElPTihjYXRfYXJteVtpXSwgMCwgMCwgMSwgMCkKICAgICAgICAgICAgICAgICAgICBUQVNLLlRBU0tfRk9MTE9XX1RPX09GRlNFVF9PRl9FTlRJVFkoY2F0X2FybXlbaV0sIHBlZCwgMCwgLTAuMywgMCwgNy4wLCAtMSwgMTAsIHRydWUpCiAgICAgICAgICAgICAgICAgICAgdXRpbC55aWVsZCgpCiAgICAgICAgICAgICAgICBlbmQgCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS5hY3Rpb24oYXJteSwgIua4hemZpOWuoOeJqeeMqyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAgICAgZm9yIGksIHBlZCBpbiBpcGFpcnMoZW50aXRpZXMuZ2V0X2FsbF9wZWRzX2FzX2hhbmRsZXMoKSkgZG8KICAgICAgICAgICAgICAgICAgICBpZiBQRUQuSVNfUEVEX01PREVMKHBlZCwgdXRpbC5qb2FhdCgiYV9jX2NhdF8wMSIpKSB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZV9lbnRpdHkocGVkKQogICAgICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIGVuZCkKCgogICAgbWVudS50b2dnbGVfbG9vcChmdW5mZWF0dXJlcywgIua/gOWFieecvCIsIHt9LCAi5oyJ5L2PRemUriIsIGZ1bmN0aW9uKG9uKQogICAgICAgIGxh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Xllcl9saXN0LCAi5a6j5biD546p5a62Iiwge30sICLlhazlrqPluIPnjqnlrrbkv6Hmga8iLCBmdW5jdGlvbigpCiAgICAgICAgICAgIAogICAgICAgICAgICBjaGF0LnNlbmRfbWVzc2FnZSgi546p5a62Ii4uUExBWUVSLkdFVF9QTEFZRVJfTkFNRShwaWQpLi4iOiAiLi4KICAgICAgICAgICAgIlxuUklEOiAiLi5wbGF5ZXJzLmdldF9yb2Nrc3Rhcl9pZChwaWQpLi4KICAgICAgICAgICAgIlxuUElEOiAiLi5waWQuLgogICAgICAgICAgICAiXG5JUDogIi4uaW50VG9JcChwbGF5ZXJzLmdldF9jb25uZWN0X2lwKHBpZCkpLi4KICAgICAgICAgICAgIlxu5Li75py65Luk54mMOiAiLi5wbGF5ZXJzLmdldF9ob3N0X3Rva2VuKHBpZCkuLgogICAgICAgICAgICAiXG7kurrnianmqKHlnos6ICIuLmludF90b191aW50KEVOVElUWS5HRVRfRU5USVRZX01PREVMKFBMQVlFUi5HRVRfUExBWUVSX1BFRChwaWQpKSkuLgogICAgICAgICAgICAiXG7nlJ/lkb3lgLw6ICIuLkVOVElUWS5HRVRfRU5USVRZX0hFQUxUSChQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSksZmFsc2UsdHJ1ZSx0cnVlKQogICAgICAgIGVuZCkKCiAgICAgICAgbWVudS5hY3Rpb24oUGxheWVyX2xpc3QsICJJUOafpeivoiIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBsb2NhbCBJUCA9IGludFRvSXAocGxheWVycy5nZXRfY29ubmVjdF9pcChwaWQpKQogICAgICAgICAgICBRdWVyeUlQKElQKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKFBsYXllcl9saXN0LCAi6Ieq5Yqo5Lyg6YCB5Yiw546p5a62Iiwge30sICLlvZPkuI7njqnlrrbnmoTot53nprvlpKfkuo4z5pe26Ieq5Yqo5Lyg6YCB5Yiw546p5a62IiwgZ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uZGx5LCAi6ZmN6JC95Yiw546p5a62Iiwge30sICLlhajoh6rliqjot7PkvJ4iLCBmdW5jdGlvbigpCiAgICAgICAgbGFuZGluZ19vbl9wbGF5ZXIocGlkKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcChmcmllbmRseSwgIuWPjeWHu+aVjOS6uiIsIHt9LCAi54K45o6J5p2A5q276K+l546p5a6255qE5Ye25omLIiwgZnVuY3Rpb24oKQogICAgICAgIHJldGFsaWF0ZV9lbmVteShwaWQpCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKGZyaWVuZGx5LCAi5a+86Iiq6ZSB5a6aIiwge30sICLnjqnlrrbnp7vliqjml7blr7zoiKrmnaHkvJrpl6rng4EiLCBmdW5jdGlvbigpCiAgICAgICAgc2V0X3dheXBvaW50KHBpZCkKICAgIGVuZCkKICAgIG1lbnUuYWN0aW9uKGZyaWVuZGx5LCAi5L+d5a2Y546p5a625L+h5oGvIiwge30sICJMdWEgU2NyaXB0cy9kYWlkYWlTY3JpcHQvcHJvZmlsZXMiLCBmdW5jdGlvbigpCiAgICAgICAgc2F2ZV9wbGF5ZXJfaW5mbyhwaWQpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbihmcmllbmRseSwgIuaOieiQvei2s+eQgyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIGJhbGxfZHJvcChwbGF5ZXJzLmdldF9wb3NpdGlvbihwaWQpKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcChmcmllbmRseSwgIua3t+S5sei2s+eQgyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIGJhbGxfZHJvcChwbGF5ZXJzLmdldF9wb3NpdGlvbihwaWQpKQogICAgICAgIHV0aWwueWllbGQoMjUwKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24oZnJpZW5kbHksICLkvKDpgIHliLDku5bnmoTovb3lhbciLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICB0cF9wX2NhcihwaWQpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbihmcmllbmRseSwgIue7meS6iOaJgOacieatpuWZqCIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIGdpdmVfYWxsX3dlYXBvbihQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSkKICAgIGVuZCkKCiAgICBzYWZlX251a2UgPSBtZW51LnRvZ2dsZShmcmllbmRseSwi5oqk6YCB5qC45by56L2mIiwge30sICLlsIbnlJ/miJDkuIDovoboo4XmnInmoLjlvLnnmoTljaHovaYs5b2T5Y2h6L2m54iG54K45pe25qC45by55Lmf5Lya54iG54K4LOi/meagt+S7u+S9leeOqeWutumDveWPr+S7peW8leeIhuaguOW8uSIsIGZ1bmN0aW9uKG9uKQogICAgICAgIGVzY29ydF9udWtlKG9uLHBpZCkKICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlX2xvb3AoZnJpZW5kbHksIuiHquWKqOWFheiDvSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIGxvY2FsIHBlZCA9IFBMQVlFUi5HRVRfUExBWUVSX1BFRF9TQ1JJUFRfSU5ERVgocGlkKQogICAgICAgIGxvY2FsIHZlaGljbGUgPSBQRUQuR0VUX1ZFSElDTEVfUEVEX0lTX1VTSU5HKHBlZCkKICAgICAgICBpZiBWRUhJQ0xFLklTX1JPQ0tFVF9CT09TVF9BQ1RJVkUodmVoaWNsZSkgdGhlbgogICAgICAgICAgICByZXBlYXQKICAgICAgICAgICAgICAgIHV0aWwueWllbGQoKQogICAgICAgICAgICB1bnRpbCBub3QgVkVISUNMRS5JU19ST0NLRVRfQk9PU1RfQUNUSVZFKHZlaGljbGUpCiAgICAgICAgICAgIE5FVFdPUksuTkVUV09SS19SRVFVRVNUX0NPTlRST0xfT0ZfRU5USVRZKHZlaGljbGUpCiAgICAgICAgICAgIFZFSElDTEUuU0VUX1JPQ0tFVF9CT09TVF9GSUxMKHZlaGljbGUsIDEwMC4wKQogIC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SA9IDEsMTAsMSBkbwogICAgICAgICAgICAgICAgc3BydW5rX3JhaW5kcm9wX3ZlaGljbGUodmVoaWNsZSkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUuYWN0aW9uKGdyZWVuX3NvZGFfcGxheWVyLCAi5Za35LiK57u/5ryGIiwge30sICLmiorku5bnmoTovb3lhbfmn5PmiJDnu7/oibIhIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBsb2NhbCB2ZWhpY2xlID0gUEVELkdFVF9WRUhJQ0xFX1BFRF9JU19JTihQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSwgZmFsc2UpCiAgICAgICAgICAgIHJlcXVlc3RfY29udHJvbCh2ZWhpY2xlKQogICAgICAgICAgICBzcHJ1bmtpZnlfdmVoaWNsZSh2ZWhpY2xlKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbihncmVlbl9zb2RhX3BsYXllciwgIuaxveawtOe9kCIsIHt9LCAi5Zyo546p5a626ZmE6L+R5o6J6JC95LiA572Q5rG95rC0IiwgZnVuY3Rpb24oKQogICAgICAgICAgICBzcHJ1bmtfcmFpbmRyb3BfcGxheWVyKHBpZCkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcChncmVlbl9zb2RhX3BsYXllciwgIuaxveawtOaatOmbqCIsIHt9LCAi5Zyo546p5a626ZmE6L+R5LiL6LW35rG95rC05pq06ZuoIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBzcHJ1bmtfcmFpbmRyb3BfcGxheWVyKHBpZCkKICAgICAgICAgICAgdXRpbC55aWVsZChzb2RhY29uZmlnLmNhbl9yYWluX2RlbGF5KQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbihncmVlbl9zb2RhX3BsYXllciwgIuWAvuWAkuWeg+Wcvue9kCIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICB0cmFzaF9kdW1wX3BsYXllcihwaWQp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minSIseyJCb3VudHlhbW91bnRwbGF5ZXIifSwiIiwxLDEwMDAwLDEwMDAwLDEwMDAsZnVuY3Rpb24oYW1vdW50KQogICAgICAgICAgICBib3VudHlfYW1vdW50ID0gYW1vdW50CiAgICAgICAgZW5kKQogICAgbWVudS5hY3Rpb24oY2xhc3NpY190cm9sbGluZywgICLouKLlh7rlrqTlhoUiLCB7fSwgIuW8uuWItuWwhueOqeWutui4ouWHuuWupOWGhS4iLCBmdW5jdGlvbigpCiAgICAgICAgS2lja19yb29tKHBpZCkKICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlKGNsYXNzaWNfdHJvbGxpbmcsICLmkpLlsL8iLCB7fSwgIumaj+WcsOWkp+Wwj+S+v+W6lOivpemBreWIsOiwtOi0oyIsIGZ1bmN0aW9uKG9uKQogICAgICAgIHBlZWxvb3BfcGxheWVyKHBpZCxvbikKICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlKGNsYXNzaWNfdHJvbGxpbmcsICLpqpHkuZjnjqnlrrYxIiwge30sICLku4XmnKzlnLDmnInmlYgiLCBmdW5jdGlvbihvbikKICAgICAgICByaWRlX3BsYXllcjEocGlkLG9uKQogICAgZW5kKQogICAgbWVudS50b2dnbGUoY2xhc3NpY190cm9sbGluZywgIumqkeS5mOeOqeWutjIiLCB7fSwgIuS7heacrOWcsOacieaViCIsIGZ1bmN0aW9uKG9uKQogICAgICAgIHJpZGVfcGxheWVyMihwaWQsb24pCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbihjbGFzc2ljX3Ryb2xsaW5nLCAiVUZP5byV5YqbIiwge30sICLkvb/nlKhVRk/lsIblroPku6zmi4notbfkuIDnp5Lpkp8iLCBmdW5jdGlvbigpCiAgICAgICAgVUZPX2dyYXZpdGF0aW9uKHBpZCkKICAgIGVuZCkKCgogICAgLS0tLeatpuWZqOaBtuaQngogICAgICAgIG1lbnUuYWN0aW9uKHdlYXBvbl90cm9sbGluZywi56e76Zmk546p5a625q2m5ZmoIiwge30sICI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CIsIHt9LCAiIikKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKG9ial9jYWdlX2x0LCAn5byA5ZCvJywge30sICflsIbnjqnlrrblm7DlnKjniankvZPnrLzlrZDph4wnLCBmdW5jdGlvbiAoKQogICAgICAgICAgICBhdXRvX29ial9jYWdlKHBpZCkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS5saXN0X3NlbGVjdChvYmpfY2FnZV9sdCwi6YCJ5oup54mp5L2T56y85a2QIiwge30sICIiLCBvYmpzZXRjYWdlLm5hbWUsIDEsIGZ1bmN0aW9uICh2YWx1ZSwgbWVudV9uYW1lLCBwcmV2X3ZhbHVlLCBjbGlja190eXBlKQogICAgICAgICAgICBzZWxlY3Rfb2JqX2NhZ2UodmFsdWUsIG1lbnVfbmFtZSwgcHJldl92YWx1ZSwgY2xpY2tfdHlwZSkKICAgICAgICBlbmQpCiAgICBtZW51LmFjdGlvbihseiwgIuivlemqjOWNh+mZjeacuiIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIHRlc3RfZWxldmF0b3IocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLnm5Hni7HnrLzlrZAiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICBQcmlzb25fY2FnZXMocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLmn7HlvaLnrLwiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICBwaWxsYXJfY2FnZShwaWQpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbihseiwgIuagheagjyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIGZlbmNlX2NhZ2UocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLlnLDni7HnrLzlrZAiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICBoZWxsX2NhZ2UocGlkKQogICAgZW5kKQogICAgbWVudS5saXN0X2FjdGlvbihseiwgIuenu+WKqOesvOWtkCI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W51LmFjdGlvbihseiwgIuaBkOaAluS5i+eJoiIsIHt9LCAi5ZCs6K+05Y2K5aSc6IO95ZCT5q275Lq6IiwgZnVuY3Rpb24oKQogICAgICAgIFRlcnJvcl9Qcmlzb24ocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLmma7pgJrnrLzlrZAiLCB7fSwgIiIsIGZ1bmN0aW9uICgpCiAgICAgICAgcHRseihwaWQpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbihseiwgIuWwj+eahOernuaKgOeuoSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIFNtYWxsX2F0aGxldGljcyhwaWQpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbihseiwgIuerluWQkei0p+acuuesvOWtkCIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIFZlcnRpY2FsX2ZyZWlnaHRlcl9jYWdlKHBpZCkKICAgIGVuZCkKICAgIG1lbnUuYWN0aW9uKGx6LCAi5qiq6KGM6LSn5py656y85a2QIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgUmFtcGFnZV9wbGFuZV9jYWdlKHBpZCkKICAgIGVuZCkKICAgIG1lbnUuYWN0aW9uKGx6LCAi5pSv5p+x56y85a2QIiwge30sICIiLCBmdW5jdGlvbiAoKQogICAgICAgIHJ1Yl9jYWdlKHBpZCkKICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlX2xvb3AobHosICLlhajoh6rliqjnrLzlrZAiLCB7fSwgIuavj+S4gOenkuWll+S4gOasoSIsIGZ1bmN0aW9uICgpCiAgICAgICAgcnViX2NhZ2UocGlkKQogICAgICAgIHV0aWwueWllbGQoMTAwMCkKICAgIGVuZCkKICAgIG1lbnUuYWN0aW9uKGx6LCAi6Iux5Zu95aWz546L56y85a2QIiwge30sICIiLCBmdW5jdGlvbihjbCkKICAgICAgICBndWVlbmNhZ2UocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLnh4PmsJTnrLwiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICBnYXNjYWdlKHBpZCkKICAgIGVuZCkKICAgIG1lbnUuYWN0aW9uKGx6LCAi5LiD5bqm56m66Ze0Iiwge30sICIiLCBmdW5jdGlvbiAoKQogICAgICAgIHFka2oocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLpkrHnrLzlrZAiLCB7fSwgIiIsIGZ1bmN0aW9uICgpCiAgICAgICAgemRseihwaWQpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbihseiwgIuWeg+WcvueusSIsIHt9LCAiIiwgZnVuY3Rpb24gKCkKICAgICAgICB5eWx6KHBpZCkKICAgIGVuZCkKICAgIG1lbnUuYWN0aW9uKGx6LCAi5bCP6L2m6L2mIiwge30sICIiLCBmdW5jdGlvbiAoKQogICAgICAgIGNjbHoocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLlnKPor57moJEiLCB7fSwgIiIsIGZ1bmN0aW9uICgpCiAgICAgICAgc2RrbDEocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLlnKPor57lv6vkuZBwcm8iLCB7fSwgIiIsIGZ1bmN0aW9uICgpCiAgICAgICAgc2RrbDIocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLlnKPor57lv6vkuZBwcm9tYXgiLCB7fSwgIiIsIGZ1bmN0aW9uICgpCiAgICAgICAgc2RrbDMocGlkKQogICAgZW5kKQogICAgbWVudS5hY3Rpb24obHosICLnq57mioDnrqEiLCB7fSwgIiIsIGZ1bmN0aW9uICgpCiAgICAgICAgampnbHoocGlkKQogICAgZW5kKQoKICAgIC0tLS0tLS0tLS1OUEPmgbbmkJ4KICAgIG1lbnUuYWN0aW9uKG5wY190cm9sbGluZywgIua0vuWPqumbquaAqiIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIHNlbmRfc25vd19tb25zdGVyKHBpZCkKICAgIGVuZCkKICAgIG1lbnUudGV4d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IiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIAogICAgICAgICAgICBsb2NhbCBwb3MgPSBwbGF5ZXJzLmdldF9wb3NpdGlvbihwaWQpCiAgICAgICAgICAgIGxvY2FsIGhhc2ggPSAtMTI2ODI2NzcxMgogICAgICAgICAgICBmb3IgaSA9IDEsMzAgZG8KICAgICAgICAgICAgICAgIGxvY2FsIGR1c3QgPSBPQkpFQ1QuQ1JFQVRFX09CSkVDVF9OT19PRkZTRVQoaGFzaCwgcG9zLngrbWF0aC5yYW5kb20oMCwgNSksIHBvcy55K21hdGgucmFuZG9tKDAsIDUpLCBwb3MueittYXRoLnJhbmRvbSgwLCA1KSwgdHJ1ZSwgZmFsc2UsIGZhbHNlKQogICAgICAgICAgICAgICAgRklSRS5BRERfRVhQTE9TSU9OKHBvcy54K21hdGgucmFuZG9tKDAsIDUpLCBwb3MueSttYXRoLnJhbmRvbSgwLCA1KSwgcG9zLnorbWF0aC5yYW5kb20oMCwgNSksIDQsIDEwMCwgdHJ1ZSwgZmFsc2UsIDEsIGZhbHNlKQogICAgICAgICAgICAgICAgdXRpbC55aWVsZCgxMDApCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRleHRzbGlkZXIoY3JlYXRlX2dhcmJhZ2VfZW50aXRpZXMsICLlhrDmt4flh4znm5vlrrQiLCB7fSwgIuWcqOS7luS7rOmdouWJjeeUn+aIkOS4gOS4quexu+S8vOWGsOa3h+WHjOeahOWunuS9kyIsIGljZV9lbnRpdHkubmFtZSwgZnVuY3Rpb24gKGluZGV4KQogICAgICAgICAgICAKICAgICAgICAgICAgbG9jYWwgb2JqID0gaWNlX2VudGl0eS52YWx1ZVtpbmRleF0KICAgICAgICAgICAgbG9jYWwgY29udGFpbmVyX2hhc2ggPSB1dGlsLmpvYWF0KG9iaikKICAgICAgICAgICAgbG9jYWwgcG9zID0gRU5USVRZLkdFVF9PRkZTRVRfRlJPTV9FTlRJVFlfSU5fV09STERfQ09PU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Tov5HnmoTmqKHlnovliKDpmaQiLCBmdW5jdGlvbigpCiAgICAgICAgU2NvcGVfZGVsZXRpb24ocGlkKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcCh0cm9sbGluZywi5by56aOe546p5a62Iiwge30sICLkuZ/pgILnlKjkuo7ovb3lhbciLCBmdW5jdGlvbigpCiAgICAgICAgQm91bmNlX0ZseWluZ19QbGF5ZXIocGlkKQogICAgZW5kKQoKICAgIC0tLS0tLS3njqnlrrbovb3lhbfmgbbmkJ4KICAgIGtpY2tfY2FyID0gbWVudS5saXN0KHZlaGljbGVfY2FyLCAi6Lii5Ye66L295YW3Iiwge30sICIiKQogICAgICAgIG1lbnUuYWN0aW9uKGtpY2tfY2FyLCAi6Lii5Ye66L295YW3djEiLCB7fSwgIui4ouWHuuW9k+WJjei9veWFt+aJgOacieS6ulxu5LiU5b2T5YmN6L295YW35LiN6IO95YaN5LiKIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBraWNrY2FyKHBpZCkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS5hY3Rpb24oa2lja19jYXIsICLouKLlh7rovb3lhbd2MiIsIHt9LCAi6ISa5pys6Lii5Ye6IiwgZnVuY3Rpb24oKQogICAgICAgICAgICAKICAgICAgICAgICAgdXRpbC50cmlnZ2VyX3NjcmlwdF9ldmVudCgxIDw8IHBpZCwge0dsb2JhbF9CYXNlLlZlaGljbGVLaWNrfSkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS5hY3Rpb24oa2lja19jYXIsICLouKLlh7rovb3lhbd2MyIsIHt9LCAi5LuO6L295YW36YeM6Lii5Ye6546p5a62IiwgZnVuY3Rpb24oKQogICAgICAgICAgICAKICAgICAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJ2ZWhraWNrIi4uIHBsYXllcnMuZ2V0X25hbWUocGlkKSkKICAgICAgICBlbmQpCiAgICBtZW51LmFjdGlvbih2ZWhpY2xlX2NhciwgIui9veWFt+WcsOWIui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ulNha3VyYSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAKICAgICAgICAgICAgbG9jYWwgY2FyID0gUEVELkdFVF9WRUhJQ0xFX1BFRF9JU19JTihQTEFZRVIuR0VUX1BMQVlFUl9QRURfU0NSSVBUX0lOREVYKHBpZCksIHRydWUpCiAgICAgICAgICAgIGlmIGNhciB+PSAwIHRoZW4KICAgICAgICAgICAgICAgIHJlcXVlc3RfY29udHJvbChjYXIpCiAgICAgICAgICAgICAgICBWRUhJQ0xFLlNFVF9WRUhJQ0xFX05VTUJFUl9QTEFURV9URVhUKGNhciwgIlNha3VyYSIpCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbihzZXRfbGljZW5zZV9wbGF0ZXMsICLlsIbovabniYzorr7nva7kuLppIGFtIFNCIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIAogICAgICAgICAgICBsb2NhbCBjYXIgPSBQRUQuR0VUX1ZFSElDTEVfUEVEX0lTX0lOKFBMQVlFUi5HRVRfUExBWUVSX1BFRF9TQ1JJUFRfSU5ERVgocGlkKSwgdHJ1ZSkKICAgICAgICAgICAgaWYgY2FyIH49IDAgdGhlbgogICAgICAgICAgICAgICAgcmVxdWVzdF9jb250cm9sKGNhcikKICAgICAgICAgICAgICAgIFZFSElDTEUuU0VUX1ZFSElDTEVfTlVNQkVSX1BMQVRFX1RFWFQoY2FyLCAiaSBhbSBTQiIpCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKCiAgICBtZW51LnRvZ2dsZSh2ZWhpY2xlX2NhciwgIuaJi+WIuSIsIHt9LCAiIiwgZnVuY3Rpb24ob24pCiAgICAgICAgCiAgICAgICAgbG9jYWwgY2FyID0gUEVELkdFVF9WRUhJQ0xFX1BFRF9JU19JTihQTEFZRVIuR0VUX1BMQVlFUl9QRURfU0NSSVBUX0lOREVYKHBpZCksIHRydWUpCiAgICAgICAgaWYgY2FyIH49IDAgdGhlbgogICAgICAgICAgICByZXF1ZXN0X2NvbnRyb2woY2FyKQogICAgICAgICAgICBWRUhJQ0xFLlNFVF9WRUhJQ0xFX0hBTkRCUkFLRShjYXIsIG9uKQogICAgICAgIGVuZAogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcCh2ZWhpY2xlX2NhciwgIumaj+acuuWItuWKqCIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIAogICAgICAgIGxvY2FsIGNhciA9IFBFRC5HRVRfVkVISUNMRV9QRURfSVNfSU4oUExBWUVSLkdFVF9QTEFZRVJfUEVEX1NDUklQVF9JTkRFWChwaWQpLCB0cnVlKQogICAgICAgIGlmIGNhciB+PSAwIHRoZW4KICAgICAgICAgICAgcmVxdWVzdF9jb250cm9sKGNhcikKICAgICAgICAgICAgVkVISUNMRS5TRVRfVkVISUNMRV9IQU5EQlJBS0UoY2FyLCB0cnVlKQogICAgICAgICAgICB1dGlsLnlpZWxkKDEwMDApCiAgICAgICAgICAgIHJlcXVlc3RfY29udHJvbChjYXIpCiAgICAgICAgICAgIFZFSElDTEUuU0VUX1ZFSElDTEVfSEFOREJSQUtFKGNhciwgZmFsc2UpCiAgICAgICAgICAgIHV0aWwueWllbGQobWF0aC5yYW5kb20oMzAwMCwgMTUwMDApKQogICAgICAgIGVuZAogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcCh2ZWhpY2xlX2NhciwgIuWGu+e7kyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIAogICAgICAgIGxvY2FsIGNhciA9IFBFRC5HRVRfVkVISUNMRV9QRURfSVNfSU4oUExBWUVSLkdFVF9QTEFZRVJfUEVEX1NDUklQVF9JTkRFWChwaWQpLCB0cnVlKQogICAgICAgIEVOVElUWS5TRVRfRU5USVRZX01BWF9TUEVFRChjYXIsIDApCiAgICBlbmQpCgogICAgbWVudS50b2dnbGVfbG9vcCh2ZWhpY2xlX2NhciwgIuenu+mZpOi9veWFt+aXoOaVjCIsI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RfbmFtZShwaWQpLi4gIiBvbiIpCiAgICAgICAgYy56ID0gYy56ICsgMTAKICAgICAgICBsb2NhbCBzcGF3bmVkdWZvID0gZW50aXRpZXMuY3JlYXRlX29iamVjdCh1Zm8sIGMpCiAgICAgICAgdXRpbC55aWVsZCgyMDAwKQogICAgICAgIGxvY2FsIGMyID0gRU5USVRZLkdFVF9FTlRJVFlfQ09PUkRTKFBMQVlFUi5HRVRfUExBWUVSX1BFRF9TQ1JJUFRfSU5ERVgocGlkKSkKICAgICAgICBGSVJFLkFERF9FWFBMT1NJT04oYzIueCwgYzIueSwgYzIueiwgMSwgMTAwLjAsIHRydWUsIGZhbHNlLCAzLjAsIGZhbHNlKQogICAgICAgIHV0aWwueWllbGQoMTAwMCkKICAgICAgICBkZWxldGVfZW50aXR5KHNwYXduZWR1Zm8pCiAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJmcmVlemUiLi4gcGxheWVycy5nZXRfbmFtZShwaWQpLi4gIiBvZmYiKQogICAgZW5kKQoKICAgIG1lbnUuYWN0aW9uKHZlaGljbGVfY2FyLCAi5Yig6Zmk6L295YW3Iiwge30sICLliKDpmaTmraTnjqnlrrbmraPlnKjpqb7pqbbnmoTovb3lhbciLCBmdW5jdGlvbigpCiAgICAgICAgZGVsZXBsYXllcmNhcihwaWQpCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKHZlaGljbGVfY2FyLCAi56aB55So6L295YW3Iiwge30sICLlvZPnjqnlrrbmiZPlvIDovabpl6jml7bliKDpmaTovb3lhbciLCBmdW5jdGlvbigpCiAgICAgICAgZGlzYWJsZV92ZWhpY2xlKHBpZCkKICAgIGVuZCkKICAgIG1lbnUudG9nZ2xlKHZlaGljbGVfY2FyLCAi56aB55So6am+6am2Iiwge30sICIiLCBmdW5jdGlvbih0b2dnbGVkKQogICAgICAgIGRpc2FibGVfZHJpdmUodG9nZ2xlZCwgcGlkKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG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RSh0cnVjaywgZmFsc2UsIDApCiAgICAgICAgICAgIFZFSElDTEUuU0VUX1ZFSElDTEVfRE9PUlNfTE9DS0VEX0ZPUl9OT05fU0NSSVBUX1BMQVlFUlModHJ1Y2ssIHRydWUpCiAgICAgICAgICAgIHV0aWwueWllbGQoMjAwMCkKICAgICAgICAgICAgZGVsZXRlX2VudGl0eSh0cnVjaykKICAgICAgICBlbmQpCiAgICAgICAgbWVudS5hY3Rpb24odmVoaWNsZV9pbXBhY3QsICLnm7TmjqXljovlgJIiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgCiAgICAgICAgICAgIGxvY2FsIHRhcmdldF9wZWQgPSBQTEFZRVIuR0VUX1BMQVlFUl9QRURfU0NSSVBUX0lOREVYKHBpZCkKICAgICAgICAgICAgY29vcmRzID0gRU5USVRZLkdFVF9FTlRJVFlfQ09PUkRTKHRhcmdldF9wZWQsIGZhbHNlKQogICAgICAgICAgICBjb29yZHMueCA9IGNvb3Jkc1sneCddCiAgICAgICAgICAgIGNvb3Jkcy55ID0gY29vcmRzWyd5J10KICAgICAgICAgICAgY29vcmRzLnogPSBjb29yZHNbJ3onXSArIDIwLjAKICAgICAgICAgICAgcmVxdWVzdF9tb2RlbCh1dGlsLmpvYWF0KCJmYWdnaW8yIikpCiAgICAgICAgICAgIGxvY2FsIHRydWNrID0gZW50aXRpZXMuY3JlYXRlX3ZlaGljbGUodXRpbC5qb2FhdCgiZmFnZ2lvMiIpLCBjb29yZHMsIDAuMCkKICAgICAgICAgICAgbG9jYWwgdmVsID0gRU5USVRZLkdFVF9FTlRJVFlfVkVMT0NJVFkodmVsKQogICAgICAgICAgICBFTlRJVFkuU0VUX0VOVElUWV9WRUxPQ0lUWSh0cnVjaywgdmVsWyd4J10sIHZlbFsneSddLCAtMjAwLjApCiAgICAgICAgICAgIFZFSElDTEUuU0VUX1ZFSElDTEVfRE9PUlNfTE9DS0VEKHRydWNrLCAzKQogICAgICAgICAgICBFTlRJVFkuU0VUX0VOVElUWV9WSVNJQkxFKHRydWNrLCBmYWxzZSwgMCkKICAgICAgICAgICAgVkVISUNMRS5TRVRfVkVISUNMRV9ET09SU19MT0NLRURfRk9SX05PTl9TQ1JJUFRfUExBWUVSUyh0cnVjaywgdHJ1ZSkKICAgICAgICAgICAgdXRpbC55aWVsZCgyMDAwKQogICAgICAgICAgICBkZWxldGVfZW50aXR5KHRydWNrKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbih2ZWhpY2xlX2ltcGFjdCwgIuWkp+WNoei9piIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICAKICAgICAgICAgICAgbG9jYWwgdGFyZ2V0X3BlZCA9IFBMQVlFUi5HRVRfUExBWUVSX1BFRF9TQ1JJUFRfSU5ERVgocGlkKQogICAgICAgICAgICBjb29yZHMgPSBFTlRJVFkuR0VUX0VOVElUWV9DT09SRFModGFyZ2V0X3BlZCwgZmFsc2UpCiAgICAgICAgICAgIGNvb3Jkcy54ID0gY29vcmRzWyd4J10KICAgICAgICAgICAgY29vcmRzLnkgPSBjb29yZHNbJ3knXQogICAgICAgICAgICBjb29yZHMueiA9IGNvb3Jkc1sneiddICsgMjAuMAogICAgICAgICAgICByZXF1ZXN0X21vZGVsKDE5MTcwMTY2MDEpCiAgICAgICAgICAgIGxvY2FsIHRydWNrID0gZW50aXRpZXMuY3JlYXRlX3ZlaGljbGUoMTkxNzAxNjYwMSwgY29vcmRzLCAwLjApCiAgICAgICAgICAgIGxvY2FsIHZlbCA9IEVOVElUWS5HRVRfRU5USVRZX1ZFTE9DSVRZKHZlbCkKICAgICAgICAgICAgRU5USVRZLlNFVF9FTlRJVFlfVkVMT0NJVFkodHJ1Y2ssIHZlbFsneCddLCB2ZWxbJ3knXSwgLTEwMC4wKQogICAgICAgICAgICBWRUhJQ0xFLlNFVF9WRUhJQ0xFX0RPT1JTX0xPQ0tFRCh0cnVjaywgMykKICAgICAgICAgICAgVkVISUNMRS5TRVRfVkVIS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GxpbmcsICLlsIbpmYTov5Hovb3lhbflkLjliLDku5bouqvkuIoiLHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIGlmIFBMQVlFUi5HRVRfUExBWUVSX1BFRChwaWQpIH49IDAgdGhlbgogICAgICAgICAgICAKICAgICAgICAgICAgbG9jYWwgcF9jID0gcGxheWVycy5nZXRfcG9zaXRpb24ocGlkKQogICAgICAgICAgICBmb3IgXywgdiBpbiBwYWlycyhlbnRpdGllcy5nZXRfYWxsX3ZlaGljbGVzX2FzX2hhbmRsZXMoKSkgZG8gCiAgICAgICAgICAgICAgICBpZiBub3QgUEVELklTX1BFRF9BX1BMQVlFUihWRUhJQ0xFLkdFVF9QRURfSU5fVkVISUNMRV9TRUFUKHYsIC0xLCBmYWxzZSkpIHRoZW4gCiAgICAgICAgICAgICAgICAgICAgbG9jYWwgdl9jID0gRU5USVRZLkdFVF9FTlRJVFlfQ09PUkRTKHYpCiAgICAgICAgICAgICAgICAgICAgbG9jYWwgYyA9IHt9CiAgICAgICAgICAgICAgICAgICAgYy54ID0gKHBfYy54IC0gdl9jLngpKjIKICAgICAgICAgICAgICAgICAgICBjLnkgPSAocF9jLnkgLSB2X2MueSApKjIKICAgICAgICAgICAgICAgICAgICBjLnogPSAocF9jLnogLSB2X2MueikqMgogICAgICAgICAgICAgICAgICAgIEVOVElUWS5BUFBMWV9GT1JDRV9UT19FTlRJVFkodiwgMSwgYy54LCBjLnksIGMueiwgMCwgMCwgMCwgMCwgZmFsc2UsIGZhbHNlLCB0cnVlLCBmYWxzZSwgZmFsc2UpCiAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kCiAgICBlbmQpICAKCiAgICBmaXJlcGlsbGFyID0gbWVudS5saXN0KHRyb2xsaW5nLCAi54Gr5p+xIiwge30sICIiKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoZmlyZXBpbGxhciwgIuW+queOr+WWt+eBq3YxIiwgeyJmbGFtZWxvb3AifSwgIueBq+eEsOaUu+WHu++8ge+8ge+8gSIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgaWYgUExBWUVSLkdFVF9QTEFZRVJfUEVEKHBpZCkgfj0gMCB0aGVuCiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIGxvY2FsIHRhcmdldF9wZWQgPSBQTEFZRVIuR0VUX1BMQVlFUl9QRURfU0NSSVBUX0lOREVYKHBpZCkKICAgICAgICAgICAgICAgIGxvY2FsIGNvb3JkcyA9IEVOVElUWS5HRVRfRU5USVRZX0NPT1JEUyh0YXJnZXRfcGVkLCBmYWxzZSkKICAgICAgICAgICAgICAgIEZJUkUuQUREX0VYUExPU0lPTihjb29yZHNbJ3gnXSwgY29vcmRzWyd5J10sIGNvb3Jkc1sneiddLCAxMiwgMTAwLjAsIHRydWUsIGZhbHNlLCAwLjApCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKGZpcmVwaWxsYXIsICLlvqrnjq/llrfngat2MiIsIHt9LCAi54Gr54Sw5pS75Ye777yB77yB77yBIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBpZiBQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSB+PSAwIHRoZW4KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgbG9jYWwgY29vcmRzID0gcGxheWVycy5nZXRfcG9zaXRpb24ocGlkKQogICAgICAgICAgICAgICAgY29vcmRzLnogPSBjb29yZHNbJ3onXSAtIDIuMAogICAgICAgICAgICAgICAgRklSRS5BRERfRVhQTE9TSU9OKGNvb3Jkcy54LCBjb29yZHMueSwgY29vcmRzLnosIDEyLCAxLCB0cnVlLCBmYWxzZSwgMCwgZmFsc2UpCiAgICAgICAgICAgICAgICB1dGlsLnlpZWxkKDI1KQogICAgICAgICAgICBlbmQKICAgICAgICBlbmQpCiAgICB3YXRlcnBpbGxhciA9IG1lbnUubGlzdCh0cm9sbGluZywgIuawtOafsSIsIHt9LCAiIikKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKHdhdGVycGlsbGFyLCAi5b6q546v5Za35rC0MSIsIHt9LCAi5rC05p+x5pS75Ye777yB77yB77yBIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBpZiBQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSB+PSAwIHRoZW4KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgbG9jYWwgY29vcmRzID0gcGxheWVycy5nZXRfcG9zaXRpb24ocGlkKQogICAgICAgICAgICAgICAgY29vcmRzLnogPSBjb29yZHNbJ3onXSAtIDIuMAogICAgICAgICAgICAgICAgRklSRS5BRERfRVhQTE9TSU9OKGNvb3Jkcy54LCBjb29yZHMueSwgY29vcmRzLnosIDEzLCAxLCB0cnVlLCBmYWxzZSwgMCwgZmFsc2UpCiAgICAgICAgICAgICAgICB1dGlsLnlpZWxkKDI1KQogICAgICAgICAgICBlbmQKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcCh3YXRlcnBpbGxhciwgIuW+queOr+WWt+awtDIiLCB7IndhdGVybG9vcCJ9LCAi5rC05p+x5pS75Ye777yB77yB77yBIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBpZiBQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSB+PSAwIHRoZW4KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgbG9jYWwgdGFyZ2V0X3BlZCA9IFBMQVlFUi5HRVRfUExBWUVSX1BFRF9TQ1JJUFRfSU5ERVgocGlkKQogICAgICAgICAgICAgICAgbG9jYWwgY29vcmRzID0gRU5USVRZLkdFVF9FTlRJVFlfQ09PUkRTKHRhcmdldF9wZWQsIGZhbHNlKQogICAgICAgICAgICAgICAgRklSRS5BRERfRVhQTE9TSU9OKGNvb3Jkc1sneCddLCBjb29yZHNbJ3knXSwgY29vcmRzWyd6J10sIDEzLCAxMDAuMCwgdHJ1ZSwgZmFsc2UsIDAuMCkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQoKICAgIG1lbnUudG9nZ2xlX2xvb3AodHJvbGxpbmcsICLov73ouKoiLCB7fSwgIuWcsOS4i+acieeXlei/uSIsIGZ1bmN0aW9uKCkKICAgICAgICBpZiBQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSB+PSAwIHRoZW4KICAgICAgICAgICAgCiAgICAgICAgICAgIGxvY2FsIGNvb3JkcyA9IHBsYXllcnMuZ2V0X3Bvc2l0aW9uKHBpZCkKICAgICAgICAgICAgY29vcmRzLnogPSBjb29yZHNbJ3onXSArIDEuNQogICAgICAgICAgICBGSVJFLkFERF9FWFBMT1NJT04oY29vcmRzLngsIGNvb3Jkcy55LCBjb29yZHMueiwgMzUsIDAsIGZhbHNlLCBmYWxzZSwgMCwgZmFsc2UpCiAgICAgICAgICAgIHV0aWwueWllbGQoNjUpCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKHRyb2xsaW5nLCAi6K6p5LuW6LWw6Lev5bim54GrIiwge30sICLot5HotbfmnaXlkKfvvIHvvIEhIiwgZnVuY3Rpb24oKQogICAgICAgIGlmIFBMQVlFUi5HRVRfUExBWUVSX1BFRChwaWQpIH49IDAgdGhlbgogICAgICAgICAgICAKICAgICAgICAgICAgbG9jYWwgY29vcmRzID0gcGxheWVycy5nZXRfcG9zaXRpb24ocGlkKQogICAgICAgICAgICBGSVJFLkFERF9FWFBMT1NJT04oY29vcmRzLngsIGNvb3Jkcy55LCBjb29yZHMueiwgMzgsIDAsIGZhbHNlLCBmYWxzZSwgMCwgZmFsc2UpCiAgICAgICAgICAgIHV0aWwueWllbGQoNjUpCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKHRyb2xsaW5nLCAi5Zyo5LuW5aS05LiK5rWH5rC0Iiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgaWYgUExBWUVSLkdFVF9QTEFZRVJfUEVE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FESU5HKHBlZCkpCiAgICAgICAgRU5USVRZLlNFVF9FTlRJVFlfVklTSUJMRShib3h2aWxsZSwgZmFsc2UpCiAgICAgICAgdXRpbC55aWVsZCgyNTApCiAgICAgICAgcmVwZWF0CiAgICAgICAgICAgIGlmIHYzLmRpc3RhbmNlKHBsYXllcnMuZ2V0X3Bvc2l0aW9uKHBpZCksIEVOVElUWS5HRVRfRU5USVRZX0NPT1JEUyhib3h2aWxsZSkpIDwgMTAuMCB0aGVuCiAgICAgICAgICAgICAgICBpZiBib3h2aWxsZSB+PSAwIGFuZCBFTlRJVFkuRE9FU19FTlRJVFlfRVhJU1QoYm94dmlsbGUpdGhlbgogICAgICAgICAgICAgICAgICAgIEVOVElUWS5BUFBMWV9GT1JDRV9UT19FTlRJVFkoYm94dmlsbGUsIDEsIDAuMCwgMC4wLCAyNS4wLCAwLjAsIDAuMCwgMC4wLCAwLCAxLCAxLCAxLCAwLCAxKQogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICB1dGlsLnlpZWxkKCkKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgZGVsZXRlX2VudGl0eShib3h2aWxsZSkKICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIHV0aWwueWllbGQoKQogICAgICAgICAgICBwb3MgPSBFTlRJVFkuR0VUX0VOVElUWV9DT09SRFMocGVkKQogICAgICAgIHVudGlsIHBvcy56ID4gMTAwMDAuMAogICAgICAgIHV0aWwueWllbGQoMTAwKQogICAgICAgIGlmIGJveHZpbGxlIH49IDAgYW5kIEVOVElUWS5ET0VTX0VOVElUWV9FWElTVChib3h2aWxsZSkgdGhlbiAKICAgICAgICAgICAgZGVsZXRlX2VudGl0eShib3h2aWxsZSkKICAgICAgICBlbmQKICAgIGVuZCkKICAgIGxvY2FsIHNvdW5kcyA9IG1lbnUubGlzdCh0cm9sbGluZywgIuWjsOmfs+aBtuaQniIsIHt9LCAiIikKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKHNvdW5kcywgIuiuqeS7luWQrOWIsOW+queOr+eIhueCuOatu+S6oeWjsOmfsyIsIHt9LCAi5ZC15q275LqGIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBpZiBQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSB+PSAwIHRoZW4KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgbG9jYWwgY29vcmRzID0gcGxheWVycy5nZXRfcG9zaXRpb24ocGlkKQogICAgICAgICAgICAgICAgQVVESU8uUExBWV9TT1VORF9GUk9NX0NPT1JEKC0xLCAiQkVEIiwgY29vcmRzLngsIGNvb3Jkcy55LCBjb29yZHMueiwgIldBU1RFRFNPVU5EUyIsIHRydWUsIDUsIGZhbHNlKQogICAgICAgICAgICAgICAgQVVESU8uUExBWV9TT1VORF9GUk9NX0NPT1JEKC0xLCAiQ3Jhc2giLCBjb29yZHMueCwgY29vcmRzLnksIGNvb3Jkcy56LCAiRExDX0hFSVNUX0hBQ0tJTkdfU05BS0VfU09VTkRTIiwgdHJ1ZSwgNSwgZmFsc2UpCiAgICAgICAgICAgICAgICBBVURJTy5QTEFZX1NPVU5EX0ZST01fQ09PUkQoLTEsICJCQVNFX0pVTVBfUEFTU0VEIiwgY29vcmRzLngsIGNvb3Jkcy55LCBjb29yZHMueiwgIkhVRF9BV0FSRFMiLCB0cnVlLCA1LCBmYWxzZSkKICAgICAgICAgICAgICAgIHV0aWwueWllbGQoMjApCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKHNvdW5kcywgIuW+queOr+atu+S6oeeahOWjsOmfsyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBpZiBQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSB+PSAwIHRoZW4KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgbG9jYWwgY29vcmRzID0gcGxheWVycy5nZXRfcG9zaXRpb24ocGlkKQogICAgICAgICAgICAgICAgQVVESU8uUExBWV9TT1VORF9GUk9NX0NPT1JEKDEsICJCRUQiLCBjb29yZHMueCwgY29vcmRzLnksIGNvb3Jkcy56LCAiV0FTVEVEU09VTkRTIiwgdHJ1ZSwgNSwgZmFsc2UpCiAgICAgICAgICAgICAgICB1dGlsLnlpZWxkKDU4MDApCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKHNvdW5kcywgIuW+queOr+a4uOiJh+WjsOmfsyIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBpZiBQTEFZRVIuR0VUX1BMQVlFUl9QRUQocGlkKSB+PSAwIHRoZW4KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgbG9jYWwgY29vcmRzID0gcGxheWVycy5nZXRfcG9zaXRpb24ocGlkKQogICAgICAgICAgICAgICAgQVVESU8uUExBWV9TT1VORF9GUk9NX0NPT1JEKC0xLCAiSG9ybiIsIGNvb3Jkcy54LCBjb29yZHMueSwgY29vcmRzLnosICJETENfQXB0X1lhY2h0X0FtYmllbnRfU291bmRzZXQiLCB0cnVlLCA1LCBmYWxzZSkKICAgICAgICAgICAgICAgIHV0aWwueWllbGQoMzAwMCkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3Aoc291bmRzLCAi5Zeh5Zeh5aOwIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIGlmIFBMQVlFUi5HRVRfUExBWUVSX1BFRChwaWQpIH49IDAgdGhlbgogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBsb2NhbCBjb29yZHMgPSBwbGF5ZXJzLmdldF9wb3NpdGlvbihwaWQpCiAgICAgICAgICAgICAgICBBVURJTy5QTEFZX1NPVU5EX0ZST01fQ09PUkQoLTEsICJDcmFzaCIsIGNvb3Jkcy54LCBjb29yZHMueSwgY29vcmRzLnosICJETENfSEVJU1RfSEFDS0lOR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ziy5q2i6KKrUEVE5ouJ5Ye66L2m5aSWIiwgZnVuY3Rpb24oKQogICAgICAgIGlmIFBFRC5JU19QRURfSU5fQU5ZX1ZFSElDTEUoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgZmFsc2UpIHRoZW4gCiAgICAgICAgICAgIGZvciBrLCBwZWQgaW4gcGFpcnMoZW50aXRpZXMuZ2V0X2FsbF9wZWRzX2FzX2hhbmRsZXMoKSkgZG8KICAgICAgICAgICAgICAgIFBFRC5TRVRfUEVEX0NPTkZJR19GTEFHKHBlZCwgMzQyLCB0cnVlKQogICAgICAgICAgICBlbmQKICAgICAgICBlbmQKICAgIGVuZCkKICAgIGxvY2FsIG1rMnByb3RleCA9IG1lbnUubGlzdCh2ZWhwcm90ZXgsICJNSy0y5oum5oiqIiwge30sICIiKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AobWsycHJvdGV4LCAi5byA5ZCv5oql5bqUIiwge30sIuiHquWKqOWkhOeQhumZhOi/kW1rMueUqOaIt+i9veWFtyIsZnVuY3Rpb24oKQogICAgICAgICAgICBvcHBLYXJtYSgpCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlKG1rMnByb3RleCwgIuebruagh+aci+WPiyIsIHt9LCLov5nkuZ/lsIbpkojlr7nkvaDnmoTmnIvlj4suIixmdW5jdGlvbihvbikKICAgICAgICAgICAgc2V0X21rMl9mcmllbmQob24pCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlKG1rMnByb3RleCwgIuebruagh+S9oOiHquW3sSIsIHt9LCLov5nkuZ/lsIbpkojlr7nkvaDoh6rlt7EuIixmdW5jdGlvbihvbikKICAgICAgICAgICAgc2V0X21rMl9zZWxmKG9uKQogICAgICAgIGVuZCkKICAgICAgICBtZW51Lmxpc3Rfc2VsZWN0KG1rMnByb3RleCwgIuaKpeW6lOaWueW8jyIsIHt9LCAi6YCJ5oup5LiA56eN5pa55byPIixvcHRpb25zTUsyS2FybWEsIDEsI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RfbGltaXQgPSBhbW91bnQKICAgICAgICBlbmQpCiAgICAgICAgbWVudS5zbGlkZXIocG9vbF9saW1pdGVyLCAi6L295YW35rGgIiwgeyJ2ZWhsaW1pdCJ9LCAi6buY6K6k5Li6MTI3IiwgMCwgMzAwLCAxODAsIDEsIGZ1bmN0aW9uKGFtb3VudCkKICAgICAgICAgICAgdmVoX2xpbWl0ID0gYW1vdW50CiAgICAgICAgZW5kKQogICAgICAgIG1lbnUuc2xpZGVyKHBvb2xfbGltaXRlciwgIueJqeS9k+axoCIsIHsib2JqbGltaXQifSwgIum7mOiupOS4ujUwMCIsIDAsIDIzMDAsIDUwMCwgMSwgZnVuY3Rpb24oYW1vdW50KQogICAgICAgICAgICBvYmpfbGltaXQgPSBhbW91bnQKICAgICAgICBlbmQpCgogICAgcl9hZG1pbiA9IG1lbnUubGlzdChldmVudF9wcm90ZXhfbGlzdCwgIlIq566h55CG5Lq65ZGY5Yqg5YWl5Y+N5bqUIiwge30sICIiKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3Aocl9hZG1pbiwgIlIq566h55CG5Lq65ZGY5Yqg5YWl5o+Q56S6Iiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIGlmIE5FVFdPUksuTkVUV09SS19JU19TRVNTSU9OX1NUQVJURUQoKSB0aGVuCiAgICAgICAgICAgICAgICBmb3IgXywgcGlkIGluIHBsYXllcnMubGlzdChmYWxzZSwgdHJ1ZSwgdHJ1ZSkgZG8gCiAgICAgICAgICAgICAgICAgICAgaWYgcGxheWVycy5pc19tYXJrZWRfYXNfYWRtaW4ocGlkKSB0aGVuIAogICAgICAgICAgICAgICAgICAgICAgICB1dGlsLnRvYXN0KCLmo4DmtYvliLDnrqHnkIblkZjliqDlhaXlk6bvvIEiKQogICAgICAgICAgICAgICAgICAgIGVuZCAgICAKICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICBlbmQKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcChyX2FkbWluLCAiUirnrqHnkIbkurrlkZjliqDlhaXlj43lupQiLCB7fSwgIuW9k+euoeeQhuWRmOWKoOWFpeaXtuiHquWKqOWKoOWFpeaWsOaImOWxgCIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgaWYgTkVUV09SSy5ORVRXT1JLX0lTX1NFU1NJT05fU1RBUlRFRCgpIHRoZW4KICAgICAgICAgICAgICAgIGZvciBfLCBwaWQgaW4gcGxheWVycy5saXN0KGZhbHNlLCB0cnVlLCB0cnVlKSBkbyAKICAgICAgICAgICAgICAgICAgICBpZiBwbGF5ZXJzLmlzX21hcmtlZF9hc19hZG1pbihwaWQpIHRoZW4gCiAgICAgICAgICAgICAgICAgICAgICAgIHV0aWwudG9hc3QoIuajgOa1i+WIsOeuoeeQhuWRmCE156eS5ZCO5Yqg5YWl5paw5oiY5bGAISIpCiAgICAgICAgICAgICAgICAgICAgICAgIHV0aWwueWllbGQoNTAwMCkKICAgICAgICAgICAgICAgICAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJnbyBwdWJsaWMiKQogICAgICAgICAgICAgICAgICAgIGVuZCAgICAKICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICBlbmQKICAgICAgICBlbmQpCgogICAgbWVudS50b2dnbGVfbG9vcChldmVudF9wcm90ZXhfbGlzdCwgIumYu+atouaOieiQveaLvuWPlueJqSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIGZvciBrLCBwaWNrdXAgaW4gcGFpcnMoZW50aXRpZXMuZ2V0X2FsbF9waWNrdXBzX2FzX2hhbmRsZXMoKSkgZG8KICAgICAgICAgICAgRU5USVRZLlNFVF9FTlRJVFlfQVNfTUlTU0lPTl9FTlRJVFkocGlja3VwLCBmYWxzZSwgZmFsc2UpCiAgICAgICAgICAgIGRlbGV0ZV9lbnRpdHkocGlja3VwKQogICAgICAgICAgICB1dGlsLnlpZWxkKDEpCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBtZ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XN0KCLlt7LpmLvmraLlj6TlpYfkuovku7YiKQogICAgICAgIGVuZAogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcChldmVudF9wcm90ZXhfbGlzdCwgIumYu+atouWFi+mahiIsIHt9LCAi6Zi75q2i55Sf5oiQ55qE5YWL6ZqGIiwgZnVuY3Rpb24oKQogICAgICAgIGZvciBfLCBwZWQgaW4gaXBhaXJzKGVudGl0aWVzLmdldF9hbGxfcGVkc19hc19oYW5kbGVzKCkpIGRvCiAgICAgICAgICAgIGlmIChFTlRJVFkuR0VUX0VOVElUWV9NT0RFTChwZWQpID09IHV0aWwuam9hYXQoIm1wX2ZfZnJlZW1vZGVfMDEiKSBvciBFTlRJVFkuR0VUX0VOVElUWV9NT0RFTChwZWQpID09IHV0aWwuam9hYXQoIm1wX21fZnJlZW1vZGVfMDEiKSkgYW5kIG5vdCBQRUQuSVNfUEVEX0FfUExBWUVSKHBlZCkgdGhlbgogICAgICAgICAgICAgICAgZGVsZXRlX2VudGl0eShwZWQpCiAgICAgICAgICAgICAgICB1dGlsLnRvYXN0KCLlt7LliKDpmaTlhYvpmoYiKQogICAgICAgICAgICBlbmQKICAgICAgICBlbmQKICAgIGVuZCkKICAgIAogICAgbWVudS5kaXZpZGVyKGV2ZW50X3Byb3RleF9saXN0LCAi572R57uc5LqL5Lu2IikKICAgIG1lbnUudG9nZ2xlKGV2ZW50X3Byb3RleF9saXN0LCAi5YWo5bGA6LaF5pe2Iiwge30sICLotoXml7bmiYDmnInkuroiLCBmdW5jdGlvbih0b2dnbGVkKQoJCWlmIHRvZ2dsZWQgdGhlbgogICAgICAgICAgICBORVRXT1JLLk5FVFdPUktfU1RBUlRfU09MT19UVVRPUklBTF9TRVNTSU9OKCktLeWIm+W7uuaWsOaJi+aVmeeoi+aImOWxgOS7peWPlua2iOS4juWFtuS7lueOqeWutuWQjOatpQogICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgTkVUV09SSy5ORVRXT1JL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zdF9leHBvc3VyZV9saXN0MSkgZG8KICAgICAgICAgICAgICAgIGdob3N0X2V4cG9zdXJlMTphY3Rpb24oIuW5veeBtSAiIC4uIGlkeCwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICAgICAgdGVsZXBvcnQoY29vcmRzWzFdLCBjb29yZHNbMl0sIGNvb3Jkc1szXSwgdHJ1ZSkKICAgICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgZW5kCiAgICAgICAgbG9jYWwgZ2hvc3RfZXhwb3N1cmUyID0gbWVudS5saXN0KGdob3N0X2V4cG9zdXJlLCAi5bm954G15pud5YWJMiIsIHt9LCAiIikKICAgICAgICAgICAgZm9yIGlkeCwgY29vcmRzIGluIHBhaXJzKGdob3N0X2V4cG9zdXJlX2xpc3QyKSBkbwogICAgICAgICAgICAgICAgZ2hvc3RfZXhwb3N1cmUyOmFjdGlvbigi5bm954G1ICIgLi4gaWR4LCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgICAgICB0ZWxlcG9ydChjb29yZHNbMV0sIGNvb3Jkc1syXSwgY29vcmRzWzNdLCB0cnVlKQogICAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBlbmQKICAgIEhhbGxvd2Vlbl9VRk8gPSBtZW51Lmxpc3Qoc2NlbmVfcGxhY2UsICJVRk/lnLDngrkiLCB7fSwgIiIpCiAgICAgICAgZm9yIGlkeCwgY29vcmRzIGluIHBhaXJzKEhhbGxvd2Vlbl9VRk9fbGlzdCkgZG8KICAgICAgICAgICAgSGFsbG93ZWVuX1VGTzphY3Rpb24oIlVGTyAiIC4uIGlkeCwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICB0ZWxlcG9ydChjb29yZHNbMV0sIGNvb3Jkc1syXSwgY29vcmRzWzNdLCB0cnVlKQogICAgICAgICAgICBlbmQpCiAgICAgICAgZW5kCiAgICBudWNsZWFyX3dhc3RlID0gbWVudS5saXN0KHNjZW5lX3Bs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CBmdW5jdGlvbih0b2dnbGVkKQogICAgICAgICAgICBnb2RfY2FtKHRvZ2dsZWQsIFBMQVlFUi5QTEFZRVJfSUQoKSkKICAgICAgICBlbmQpCiAgICAgICAgbWVudS50b2dnbGVfbG9vcChjYW1fbGlzdCwgIumUgeWumua4uOaIj+inhuinkiIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBDQU0uU0VUX0dBTUVQTEFZX0NBTV9SRUxBVElWRV9IRUFESU5HKDApCiAgICAgICAgZW5kKQogICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoY2FtX2xpc3QsICLnpoHnlKjnqbrpl7LnlLvpnaIiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgQ0FNLklOVkFMSURBVEVfSURMRV9DQU0oKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKGNhbV9saXN0LCAi56aB55So56m66Zey6L2m6L6G55S76Z2iIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIENBTS5JTlZBTElEQVRFX0NJTkVNQVRJQ19WRUhJQ0xFX0lETEVfTU9ERSgpCiAgICAgICAgZW5kKQoKICAgIGxvY2FsIERpc2FibGVfb3B0aW9uID0gbWVudS5saXN0KGdhbWVfbGlzdCwgIuemgeeUqOmAiemhuSIsIHt9LCAiIikKICAgICAgICBtZW51LnRvZ2dsZV9sb29wKERpc2FibGVfb3B0aW9uLCAi56aB55So55S75pWIIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgICAgIEdSQVBISUNTLkFOSU1QT1NURlhfU1RPUF9BTEwoKQogICAgICAgIGVuZCkKICAgICAgICBsb2NhbCBhdWRpb19vcHRpb24gPSBtZW51Lmxpc3QoRGlzYWJsZV9vcHRpb24sICLpn7PmlYjnpoHnlKgiLCB7fSwgIiIpCiAgICAgICAgICAgIG1lbnUudG9nZ2xlKGF1ZGlvX29wdGlvbiwgIuemgeeUqOiEmuatpeWjsCIsIHt9LCAiIiwgZnVuY3Rpb24oc3RhdGUpCiAgICAgICAgICAgICAgICBBVURJTzEuU0VUX1BFRF9BVURJT19GT09UU1RFUF9MT1VEKFBMQVlFUi5QTEFZRVJfUEVEX0lEKCksIG5vdCBzdGF0ZSkKICAgICAgICAgICAgICAgIEFVRElPLlNFVF9QRURfQ0xPVEhfRVZFTlRTX0VOQUJMRUQoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgbm90IHN0YXRlKQogICAgICAgICAgICAgICAgQVVESU8uU0VUX1BFRF9GT09UU1RFUFNfRVZFTlRTX0VOQUJMRUQoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgbm90IHN0YXRlKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoYXVkaW9fb3B0aW9uLCAi56aB55So5bCW5Y+rIiwge30sICLnpoHnlKhOUEPlsJblj6vlo7AiLCBmdW5jdGlvbigpCQogICAgICAgICAgICAgICAgZm9yIGssIHBlZCBpbiBwYWlycyAoZW50aXRpZXMuZ2V0X2FsbF9wZWRzX2FzX2hhbmRsZXMoKSkgZG8KICAgICAgICAgICAgICAgICAgICBpZiBwZWQgfj0gUExBWUVSLlBMQVlFUl9QRURfSUQoKSB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgIEFVRElPLkRJU0FCTEVfUEVEX1BBSU5fQVVESU8ocGVkLCB0cnVlKQogICAgICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS50b2dnbGVfbG9vcChhdWRpb19vcHRpb24sICLnpoHnlKjlr7nor50iLCB7fSwgIuemgeeUqE5QQ+WvueivneWjsCIsIGZ1bmN0aW9uKCkJCiAgICAgICAgICAgICAgICBmb3IgaywgcGVkIGluIHBhaXJzIChlbnRpdGllcy5nZXRfYWxsX3BlZHNfYXNfaGFuZGxlcygpKSBkbwogICAgICAgICAgICAgICAgICAgIGlmIHBlZCB+PSBQTEFZRVIuUExBWUVSX1BFRF9JRCgpIHRoZW4KICAgICAgICAgICAgICAgICAgICAgICAgQVVESU8uU1RPUF9DVVJSRU5UX1BMQVlJTkdfU1BFRUNIKHBlZCkKICAgICAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoYXVkaW9fb3B0aW9uLCAi56aB55So5o+Q56S6Iiwge30sICLnpoHnlKjnlLHku7vliqHmiJbluK7mtL7mlLvlh7vnrYnlvJXotbfnmoTpn7PmlYgiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBpZiBBVURJTy5BVURJT19JU19NVVNJQ19QTEFZSU5HKCkgYW5kIG5vdCBORVRXT1JLLk5FVFdPUktfSVNfQUNUSVZJVFlfU0VTU0lPTigpIHRoZW4KICAgICAgICAgICAgICAgICAgICBBVURJTy5UUklHR0VSX01VU0lDX0VWRU5UKCJHTE9CQUxfS0lMTF9NVVNJQyIpCiAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAgIHlpZWxkKDUwMCkKICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBtZW51LnRvZ2dsZShhdWRpb19vcHRpb24sICLnpoHnlKjorabnrJsiLCB7fSwgIuemgeeUqOiHqueUseaooeW8j+S4i+WQrOWIsOeahOi/nOWkhOitpuesm+WjsCIsIGZ1bmN0aW9uKHRvZ2dsZWQpCiAgICAgICAgICAgICAgICBBVURJTy5ESVNUQU5UX0NPUF9DQVJfU0lSRU5TKG5vdCB0b2dnbGVkKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUudG9nZ2xlX2xvb3AoYXVkaW9fb3B0aW9uLCAi56aB55So6K2m5oqlIiwge30sICLnpoHnlKjlgbfovabml7blj5Hlh7rnmoTorabmiqUiLCBmdW5jdGlvbigpCiAgICAgICAgICAgICAgICBsb2NhbCB2ZWhpY2xlID0gVkVISUNMRS5HRVRfVkVISUNMRV9QRURfSVNfVFJZSU5HX1RPX0VOVEVSKFBMQVlFUi5QTEFZRVJfUEVEX0lEKCkpCiAgICAgICAgICAgICAgICBpZiBWRUhJQ0xFLklTX1ZFSElDTEVfQUxBUk1fQUNUSVZBVEVEKHZlaGljbGUpIHRoZW4KICAgICAgICAgICAgICAgICAgICBWRUhJQ0xFLlNFVF9WRUhJQ0xFX0FMQVJNKHZlaGljbGUsIGZhbHNlKQogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgbWVudS50b2dnbGVfbG9vcChhdWRpb19vcHRpb24sICLnpoHnlKjpuKPnrJsiLCB7fSwgIuemgeeUqE5QQ+WcqOi9puWGheatu+S6oeaXtueahOm4o+esmyIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgICAgIGZvciBrLCBwZWQgaW4gcGFpcnMgKGVudGl0aWVzLmdldF9hbGxfcGVkc19hc19oYW5kbGVzKCkpIGRvCiAgICAgICAgICAgICAgICAgICAgUEVELlNFVF9QRURfQ09ORklHX0ZMQUcocGVkLCA0NiwgdHJ1ZSkKICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUudG9nZ2xlKGF1ZGlvX29wdGlvbiwgIuemgeeUqOaJq+aPjyIsIHt9LCAi56aB55So6K2m5a+f5omr5o+P5Luq5aOw6Z+zIiwgZnVuY3Rpb24odG9nZ2xlZCkKICAgICAgICAgICAgICAgIEFVRElPLlNFVF9BVURJT19GTEFHKCJQb2xpY2VTY2FubmVyRGlzYWJsZWQiLCB0b2dnbGVkKQogICAgICAgICAgICBlbmQpCgogICAgbG9jYWwgcGhvbmVfbGlzdCA9IG1lbnUubGlzdChnYW1lX2xpc3QsICLnlLXor53pgInpobkiLCB7fSwiIikKICAgICAgICBtZW51LnRvZ2dsZShwaG9uZV9saXN0LCAi56aB55So5omL5py6Iiwge30sICIiLCBmdW5jdGlvbih0b2dnbGUpCiAgIC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3Rpb24oKQogICAgICAgIGxvY2FsIGNvb3JkcyA9IEVOVElUWS5HRVRfRU5USVRZX0NPT1JEUyhQTEFZRVIuUExBWUVSX1BFRF9JRCgpLCB0cnVlKQogICAgICAgIGNvb3Jkc1sneCddID0gY29vcmRzWyd4J10gKyBtYXRoLnJhbmRvbSgtMTAwLCAxMDApCiAgICAgICAgY29vcmRzWyd5J10gPSBjb29yZHNbJ3knXSArIG1hdGgucmFuZG9tKC0xMDAsIDEwMCkKICAgICAgICBjb29yZHNbJ3onXSA9IGNvb3Jkc1sneiddICsgbWF0aC5yYW5kb20oMzAsIDEwMCkKICAgICAgICBGSVJFLkFERF9FWFBMT1NJT04oY29vcmRzWyd4J10sIGNvb3Jkc1sneSddLCBjb29yZHNbJ3onXSwgMzgsIDEwMC4wLCB0cnVlLCBmYWxzZSwgMC4wKQogICAgICAgIHV0aWwueWllbGQoMTAwKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcChjdXN0b21fZmlyZXdvcmtzLCAi5aSn54Of6IqxIiwge30sICIiLCBmdW5jdGlvbiAoKQogICAgICAgIGJpZ19maXJld29ya3MoKQogICAgZW5kKQogICAgbWVudS50b2dnbGVfbG9vcChjdXN0b21fZmlyZXdvcmtzLCAi54Kr5b2p54Of6IqxIiwge30sICIiLCBmdW5jdGlvbiAoKQogICAgICAgIG5ld19maXJld29yaygpCiAgICBlbmQpCiAgICBtZW51LnRvZ2dsZV9sb29wKGN1c3RvbV9maXJld29ya3MsICLnpLzoirHmobYiLCB7fSwgIiIsIGZ1bmN0aW9uICgpCiAgICAgICAgbmV3X2ZpcmV3b3JrMigpCiAgICBlbmQpCiAgICBtZW51LmFjdGlvbihjdXN0b21fZmlyZXdvcmtzLCAi5pWj5bCE54Of6IqxIiwge30sICIiLCBmdW5jdGlvbigpCiAgICAgICAgZm9yIGkgPSAxLCA1IGRvCiAgICAgICAgICAgIGxvY2FsIGNvb3JkcyA9IEVOVElUWS5HRVRfT0ZGU0VUX0ZST01f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dnbGUpCglpZiBvbl90b2dnbGUgdGhlbgoJCW1lbnUudHJpZ2dlcl9jb21tYW5kcygid2VhdGhlciIgLi4gIiBleHRyYXN1bm55IiktLS3orr7nva7lpKnmsJQKCQltZW51LnRyaWdnZXJfY29tbWFuZHMoImNsb3VkcyIgLi4gIiBjbGVhcjAxIiktLS3orr7nva7kupEKICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoInBvdGF0b21vZGUgIiktLS3lvIDlkK/lnJ/osYYKICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoIm5vc2t5ICIpLS0t56e76Zmk5aSp56m6CiAgICAgICAgbWVudS50cmlnZ2VyX2NvbW1hbmRzKCJub2lkbGVjYW0gIiktLS3npoHnlKjmjILmnLrplZzlpLQKCWVsc2UKCQltZW51LnRyaWdnZXJfY29tbWFuZHMoIndlYXRoZXIiIC4uICIgbm9ybWFsIikKCQltZW51LnRyaWdnZXJfY29tbWFuZHMoImNsb3VkcyIgLi4gIiBub3JtYWwiKQogICAgICAgIG1lbnUudHJpZ2dlcl9jb21tYW5kcygicG90YXRvbW9kZSAiKQogICAgICAgIG1lbnUudHJpZ2dlcl9jb21tYW5kcygibm9za3kgIikKICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoIm5vaWRsZWNhbSAiKQoJZW5kCmVuZCkKCm1lbnUudG9nZ2xlX2xvb3Aod29ybGRsaXN0LCLovbDngrjljLoiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgIGJvbWJfYXJlYSgpCmVuZCkKCgp0cmFpbl9saXN0ID0gbWVudS5saXN0KHdvcmxkbGlzdCwgIuWIl+i9pumAiemhuSIsIHt9LCAiIikKICAgIHRyYWluX2J1aWxkID0gbWVudS5saXN0KHRyYWluX2xpc3QsICLngavovabnlJ/miJAiLCB7fSwgIuWmgumZhOi/keacquaJvuWIsOeBq+i9pizlj6/liY3lvoDpk4HovajpmYTov5Hph43mlrDnlJ/miJAiKQogICAgICAgIG1lbnUuY2xpY2tfc2xpZGVyKHRyYWluX2J1aWxkLCAi54Gr6L2m55Sf5oiQ57G75Z6LIiwge30sICLngrnlh7vnlJ/miJDkuI3lkIznsbvlnovngavovaYiLCAxLCAyMywgMSwgMSwgZnVuY3Rpb24odmFyaWF0aW9uKQogICAgICAgICAgICBsb2NhbCBwb3MgPSBFTlRJVFkuR0VUX0VOVElUWV9DT09SRFMoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgMSkKICAgICAgICAgICAgc3Bhd25fdHJhaW4odmFyaWF0aW9uIC0gMSwgcG9zKQogICAgICAgIGVuZCkKICAgICAgICBtZW51LmFjdGlvbih0cmFpbl9idWlsZCwgIueUn+aIkOWcsOmTgSIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBsb2NhbCBwb3MgPSBFTlRJVFkuR0VUX0VOVElUWV9DT09SRFMoUExBWUVSLlBMQVlFUl9QRURfSUQoKSwgMSkKICAgICAgICAgICAgc3Bhd25fdHJhaW4oMjEsIHBvcykKICAgICAgICBlbmQpCiAgICAgICAgbWVudS5hY3Rpb24odHJhaW5fYnVpbGQsICLliKDpmaTmiYDmnInngavovaYiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICAgICAgbG9jYWwgdmVoaWNsZXMgPSBlbnRpdGllcy5nZXRfYWxsX3ZlaGljbGVzX2FzX2hhbmRsZXMoKQogICAgICAgICAgICBmb3IgaywgdmVoIGluIHBhaXJzKHZlaGljbGVzKSBkbwogICAgICAgICAgICAgICAgZGVsZXRlX2VudGl0eSh2ZWgpCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZCkKICAgIG1lbnUuYWN0aW9uKHRyYWluX2xpc3QsICLpqb7pqbbpmYTov5HnmoTngavovaYiLCB7fSwgIiIsIGZ1bmN0aW9uKCkKICAgICAgICBsb2NhbCB0cmFpbiA9IGdldF9jbG9zZXN0X3RyYWluKCkKICAgICAgICBpZiB0cmFpbiB+PSAwIHRoZW4KICAgICAgICAgICAgZGVsZXRlX2VudGl0eShWRUhJQ0xFLkdFVF9QRURfSU5fVkVISUNMRV9TRUFUKHRyYWluLCAtMSkpCiAgICAgICAgICAgIFBFRC5TRVRfUEVEX0lOVE9fVkVISUNMRShQTEFZRVIuUExBWUVSX1BFRF9JRCgpLCB0cmFpbiwgLTEpCiAgICAgICAgICAgIEFVRElPLlNFVF9WRUhJQ0xFX1JBRElPX0VOQUJMRUQodHJhaW4sIHRydWUpCiAgICAgICAgZW5kCiAgICBlbmQpCiAgICBzZXRfdHJhaW5fc3BlZWQgPSBtZW51Lmxpc3QodHJhaW5fbGlzdCwi6K6+572u5YiX6L2m6YCf5bqmIiwge30sICIiKQogICAgICAgIGxvY2FsIHRyYWluX3NwZWVkID0gNTUvMy42CiAgICAgICAgbWVudS50b2dnbGVfbG9vcChzZXRfdHJhaW5fc3BlZWQsIuiuvue9ruWIl+i9pumAn+W6piIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgICAgICBmb3IgXywgdmVoIGluIHBhaXJzKGVudGl0aWVzLmdldF9hbGxfdmVoaWNsZXNfYXNfcG9pbnRlcnMoKSkgZG8gCiAgICAgICAgICAgICAgICBpZiBlbnRpdGllcy5nZXRfbW9kZWxfaGFzaCh2ZWgpID09IHV0aWwuam9hYXQoImZyZWlnaHQiKSB0aGVuCiAgICAgICAgICAgICAgICAgICAgdHJhaW5faGRsID0gZW50aXRpZXMucG9pbnRlcl90b19oYW5kbGUodmVoKQogICAgICAgICAgICAgICAgICAgIHJlcXVlc3RfY29udHJvbCh0cmFpbl9oZGwpCiAgICAgICAgICAgICAgICAgICAgVkVISUNMRS5TRVRfVFJBSU5fU1BFRUQodHJhaW5faGRsLCB0cmFpbl9zcGVlZCkKICAgICAgICAgICAgICAgICAgICBWRUhJQ0xFLlNFVF9UUkFJTl9DUlVJU0VfU1BFRUQodHJhaW5faGRsLCB0cmFpbl9zcGVlZCkKICAgICAgICAgICAgICAgIGVuZAogICAgICAgICAgICBlbmQKICAgICAgICBl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AgICB2aXN1YWxfdG9nZ2xlID0gbWVudS50b2dnbGUodmlzdWFsX2ZpZGVsaXR5LCB2aXN1YWxfbmFtZSwge30sICIiLCBmdW5jdGlvbih0b2dnbGVkKQogICAgICAgICAgICAgICAgdmlzdWFsID0gdG9nZ2xlZAogICAgICAgICAgICAgICAgaWYgbm90IG1lbnUuZ2V0X3ZhbHVlKHZpc3VhbF90b2dnbGUpIHRoZW4KICAgICAgICAgICAgICAgICAgICBHUkFQSElDUy5BTklNUE9TVEZYX1NUT1BfQUxMKCkKICAgICAgICAgICAgICAgIHJldHVybiBlbmQKCiAgICAgICAgICAgICAgICB3aGlsZSB2aXN1YWwgZG8KICAgICAgICAgICAgICAgICAgICBHUkFQSElDUy5TRVRfVElNRUNZQ0xFX01PRElGSUVSKHZpc3VhbF90aGluZykKICAgICAgICAgICAgICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoInNoYWRlciBvZmYiKQogICAgICAgICAgICAgICAgICAgIHV0aWwueWllbGQoMjUwKQogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgICBHUkFQSElDUy5TRVRfVElNRUNZQ0xFX01PRElGSUVSKCJERUZBVUxUIikKICAgICAgICAgICAgZW5kKQogICAgICAgIGVuZCAKCiAgICBkcnVnX21vZGUgPSBtZW51Lmxpc3QodmlzdWFsbGlzdCwgIuiNr+eJqei/h+a7pOWZqCIsIHt9LCAiIikKICAgICAgICBmb3IgaWQsIGRhdGEgaW4gcGFpcnMoZHJ1Z2dlZF9lZmZlY3RzKSBkbwogICAgICAgICAgICBtZW51LnRvZ2dsZShkcnVnX21vZGUsIGRhdGEsIHt9LCAiIiwgZnVuY3Rpb24odG9nZ2xlZCkKICAgICAgICAgICAgICAgIGlmIHRvZ2dsZWQgdGhlbgogICAgICAgICAgICAgICAgICAgIEdSQVBISUNTLlNFVF9USU1FQ1lDTEVfTU9ESUZJRVIoZGF0YSkKICAgICAgICAgICAgICAgICAgICBtZW51LnRyaWdnZXJfY29tbWFuZHMoInNoYWRlciBvZmYiKQogICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgIEdSQVBISUNTLlNFVF9USU1FQ1lDTEVfTU9ESUZJRVIoIkRFRkFVTFQiKQogICAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgIGVuZCkKICAgICAgICBlbmQKCiAgICB2aXNpb25zID0gbWVudS5saXN0KHZpc3VhbGxpc3QsICLlsY/luZXmlYjmnpwiLCB7fSwgIiIpCiAgICAgICAgZm9yIGlkLCBkYXRhIGluIHBhaXJzKGVmZmVjdF9zdHVmZikgZG8KICAgICAgICAgICAgbG9jYWwgZWZmZWN0X25hbWUgPSBkYXRhWzFdCiAgICAgICAgICAgIGxvY2FsIGVmZmVjdF90aGluZyA9IGRhdGFbMl0KICAgICAgICAgICAgbG9jYWwgZWZmZWN0ID0gZmFsc2UKICAgICAgICAgICAgbG9jYWwgZWZmZWN0X3RvZ2dsZQogICAgICAgICAgICBlZmZlY3RfdG9nZ2xlID0gbWVudS50b2dnbGUodmlzaW9ucywgZWZmZWN0X25hbWUsIHt9LCAiIiwgZnVuY3Rpb24odG9nZ2xlZCkKICAgICAgICAgICAgICAgIGVmZmVjdCA9IHRvZ2dsZWQKICAgICAgICAgICAgICAgIGlmIG5vdCBtZW51LmdldF92YWx1ZShlZmZlY3RfdG9nZ2xlKSB0aGVuCiAgICAgICAgICAgICAgICAgICAgR1JBUEhJQ1MuQU5JTVBPU1RGWF9TVE9QX0FMTCgpCiAgICAgICAgICAgICAgICByZXR1cm4gZW5kCgogICAgICAgICAgICAgICAgd2hpbGUgZWZmZWN0IGRvCiAgICAgICAgICAgICAgICAgICAgR1JBUEhJQ1MuQU5JTVBPU1RGWF9QTEFZKGVmZmVjdF90aGluZywgNSwgdHJ1ZSkKICAgICAgICAgICAgICAgICAgICB1dGlsLnlpZWxkKDEwMDApCiAgICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgZW5kKQogICAgICAgIGVuZAoKCgotLS0t5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OaenCcpCiAgICBtZW51LnRvZ2dsZV9sb29wKHdhdGVybWFyaywgIuW8gOWQryIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIHdhdGVybWFya190b2dnbGUoKQogICAgZW5kKQogICAgbWVudS5kaXZpZGVyKHdhdGVybWFyaywgIuiuvue9riIpCiAgICAgICAgcG9zX3NldHRpbmdzID0gbWVudS5saXN0KHdhdGVybWFyaywgIuS9jee9riIsIHt9LCAiIikKICAgICAgICAgICAgbWVudS5zbGlkZXIocG9zX3NldHRpbmdzLCAieOWdkOaghyIsIHsid2F0ZXJtYXJrLXgifSwgIiIsIC0xMDAwMDAsIDEwMDAwMCwgd2F0ZXJtYXJrX3Bvcy54ICogMTAwMDAsIDEwLCBmdW5jdGlvbih4XykKICAgICAgICAgICAgICAgIHdhdGVybWFya194KHhfKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUuc2xpZGVyKHBvc19zZXR0aW5ncywgInnlnZDmoIciLCB7IndhdGVybWFyay15In0sICIiLCAtMTAwMDAwLCAxMDAwMDAsIHdhdGVybWFya19wb3MueSAqIDEwMDAwLCAxMCwgZnVuY3Rpb24oeV8pCiAgICAgICAgICAgICAgICB3YXRlcm1hcmtfeSh5XykKICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBtZW51LnNsaWRlcihwb3Nfc2V0dGluZ3MsICLog4zmma/plb/luqYiLCB7IndhdGVybWFyay1hZGR4In0sICIiLCAtMTAwMDAwLCAxMDAwMDAsIHdhdGVybWFya19zZXR0aW5ncy5hZGRfeCAqIDEwMDAwLCAxMCwgZnVuY3Rpb24oeF8pCiAgICAgICAgICAgICAgICB3YXRlcm1hcmtfYmd4KHhfKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIG1lbnUuc2xpZGVyKHBvc19zZXR0aW5ncywgIuiDjOaZr+WuveW6piIsIHsid2F0ZXJtYXJrLWFkZHkifSwgIiIsIC0xMDAwMDAsIDEwMDAwMCwgd2F0ZXJtYXJrX3NldHRpbmdzLmFkZF95ICogMTAwMDAsIDEwLCBmdW5jdGlvbih5XykKICAgICAgICAgICAgICAgIHdhdGVybWFya19iZ3koeV8pCiAgICAgICAgICAgIGVuZCkKICAgICAgICB3YXRlcm1hcmtjb2xvcl9zZXR0aW5ncyA9IG1lbnUubGlzdCh3YXRlcm1hcmssICLpopzoibIiLCB7fSwgIiIpCiAgICAgICAgICAgIGxvY2FsIHJnYl9iYWNrZ3JvdW5kID0gbWVudS5jb2xvdXIod2F0ZXJtYXJrY29sb3Jfc2V0dGluZ3MsICfog4zmma/popzoibInLCB7J3dhdGVybWFyay1iZ19jb2xvcid9LCAnJywgd2F0ZXJtYXJrX3NldHRpbmdzLmJnX2NvbG9yLCB0cnVlLCBmdW5jdGlvbihjb2wpCiAgICAgICAgICAgICAgICB3YXRlcm1hcmtfYmdjKGNvbCkKICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBsb2NhbCByZ2JfdGV4dCA9IG1lbnUuY29sb3VyKHdhdGVybWFya2NvbG9yX3NldHRpbmdzLCAn5paH5pys6aKc6ImyJywgeyd3YXRlcm1hcmstdHhfY29sb3InfSwgJycsIHdhdGVybWFya19zZXR0aW5ncy50eF9jb2xvciwgdHJ1ZSwgZnVuY3Rpb24oY29sKQogICAgICAgICAgICAgICAgd2F0ZXJtYXJrX3R4dGMoY29sKQogICAgICAgICAgICBlbmQpCiAgICBtZW51LmRpdmlkZXIod2F0ZXJtYXJrLCAi6ZmE5YqgIikKICAgICAgICBtZW51Lmxpc3Rfc2VsZWN0KHdhdGVybWFyaywgJ+esrOS4gOagh+etvicsIHt9LCAn5pu05pS55rC057q/5Lit55qE56ys5LiA5Liq5qCH562+JywgbWFya2xhYmVsX25hbWUsIHdhdGVybWFya19zZXR0aW5ncy5zaG93X2ZpcnN0bCwgZnVuY3Rpb24gKHZhbHVlLCBtZW51X25hbWUsIHByZXZfdmFsdWUsIGNsaWNrX3R5cGUpCiAgICAgICAgICAgIHdhdGVybWFya19sYWJ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gLyAxMDAwMAogICAgZW5kKQogICAgbWVudS5zbGlkZXIod2FzZHd3LCAn5aSn5bCPJywgeycnfSwgJycsMSAsIDEwMDAwLCAzMDAsIDIwLCBmdW5jdGlvbih2YWx1ZSkKICAgICAgICBzaXplID0gdmFsdWUgLyAxMDAwMAogICAgICAgIGJveE1hcmdpbiA9IHNpemUgLyA3CiAgICBlbmQpCgprb25nemhpdGFpID0gbWVudS5saXN0KG90aGVybGlzdCwgIuaOp+WItuWPsCIsIHt9LCAiIikKICAgIG1lbnUudG9nZ2xlX2xvb3Aoa29uZ3poaXRhaSwgIue7mOWItuaOp+WItuWPsCIsIHt9LCAiIiwgZnVuY3Rpb24oKQogICAgICAgIERyYXdfY29uc29sZSgpCiAgICBlbmQpCiAgICBtZW51LnNsaWRlcihrb25nemhpdGFpLCAi5pyA5aSn5pi+56S65a2X5pWwIiwge30sICIiLCAxLCAyMDAsIDExMCwgMSwgZnVuY3Rpb24ocykKICAgICAgICBjb25zb2xlX21heF9jaGFycyhzKQogICAgZW5kKQogICAgbWVudS5zbGlkZXIoa29uZ3poaXRhaSwgIuacgOWkp+aYvuekuuihjOaVsCIsIHt9LCAiIiwgMSwgNjAsIDI1LCAxLCBmdW5jdGlvbihzKQogICAgICAgIGNvbnNvbGVfbWF4X2xpbmVzKHMpCiAgICBlbmQpCiAgICBtZW51LnNsaWRlcl9mbG9hdChrb25nemhpdGFpLCAi5a2X5L2T5aSn5bCPIiwge30sICIiLCAxLCAxMDAsIDQ1LCAxLCBmdW5jdGlvbihzKQogICAgICAgIGNvbnNvbGVfZm9udF9zaXplKHMpCiAgICBlbmQpCiAgICBtZW51LmNvbG91cihrb25nemhpdGFpLCAi5a2X5L2T6aKc6ImyIiwgeyJuY29uc29sZXRleHRjb2xvciJ9LCAiIiwgMC4yNywgMSwgMSwgMSwgdHJ1ZSwgZnVuY3Rpb24ob25fY2hhbmdlKQogICAgICAgIGNvbnNvbGVfdGV4dF9jb2xvciA9IG9uX2NoYW5nZQogIC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